Code Monkey home page Code Monkey logo

Comments (8)

rjrudin avatar rjrudin commented on August 18, 2024

Another example for shell usage:

ml.corb().deleteCollection("collection-name")

That would construct a uris query for the given collection, and then a simple process module of "xdmp:document-delete($URI)". That would be very handy for deleting collections that are too large to delete in qconsole, but it's annoying to have to create two modules just to get this done.

from corb2.

bbandlamudi avatar bbandlamudi commented on August 18, 2024

Hi Rob,
I am little unclear about URIS-QUERY option. Since we can do URIS-MODULE=my-module.xqy|ADHOC where my-module.xqy stays in local file system (wherever corb is running from, not modules db), I am wondering if this would suffice instead of URIS-QUERY input param.

from corb2.

rjrudin avatar rjrudin commented on August 18, 2024

URIS-MODULE requires that the module exist on the filesystem. URIS-QUERY would allow for the module to be created programmatically and passed in as a string without ever being written to the filesystem. This is useful in allowing corb to be invoked from another program vs having to be invoked from the command line. Ideally, that program could eventually do something like this:

Manager m = new Manager()
m.setConnectionString(...)
m.setUrisQuery("cts:uris(...)")
m.setProcessTask("some.class.name")
m.setThreadCount(4)
m.run()

corb has always been a command-line driven tool, and I think it would increase its usability by developing the above sort of API underneath the command-line interface.

from corb2.

bbandlamudi avatar bbandlamudi commented on August 18, 2024

I started adding a new option URIS-QUERY, which is fairly easy. But I couldn't figure out an intuitive way to specify the language i.e., javascript or xquery. If none specified, xcc defaults to xquery. We can come up with two options URIS-QUERY and URIS-QUERY-JAVASCIPT, but I prefer a single option and optionally pass in language as part of the query string definition. Any ideas?

from corb2.

mpheckel avatar mpheckel commented on August 18, 2024

Rob, in case you aren’t familiar with it.. the ModuleExecutor class can be used for single stage transforms like deleting docs within a collection. It was written to replace an old app called runXQuery. It can handle queries written in either XQuery or JavaScript. It’s discussed at the bottom of the readMe.md file.

From: rjrudin [mailto:[email protected]]
Sent: Tuesday, December 22, 2015 11:08 PM
To: marklogic/corb2
Subject: Re: [corb2] Set URIs via an input parameter that is a query (#10)

Another example for shell usage:

ml.corb().deleteCollection("collection-name")

That would construct a uris query for the given collection, and then a simple process module of "xdmp:document-delete($URI)". That would be very handy for deleting collections that are too large to delete in qconsole, but it's annoying to have to create two modules just to get this done.


Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-166798909.

from corb2.

rjrudin avatar rjrudin commented on August 18, 2024

I don't think ModuleExecutor will address my use case, because it too requires a module either in the database or on the filesystem.

What I'm after is a way to run corb without having to reference a module on the filesystem or in the modules database. That means the uris and transform queries need to be able to be passed in as strings.

from corb2.

mpheckel avatar mpheckel commented on August 18, 2024

Agreed, ModuleExecutor will not solve that issue. My suggestion was to address another issue you mentioned which was having to set up a two stage job when you only needed one.

From: rjrudin [mailto:[email protected]]
Sent: Tuesday, December 29, 2015 4:47 PM
To: marklogic/corb2
Cc: Matt Heckel
Subject: Re: [corb2] Set URIs via an input parameter that is a query (#10)

I don't think ModuleExecutor will address my use case, because it too requires a module either in the database or on the filesystem.

What I'm after is a way to run corb without having to reference a module on the filesystem or in the modules database. That means the uris and transform queries need to be able to be passed in as strings.


Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-167884706.

from corb2.

bbandlamudi avatar bbandlamudi commented on August 18, 2024

I think, we can overload the existing URIS-MODULE, PROCESS-MODULE etc. If the value starts with a specific string such as "INLINE-XQUERY|" or "INLINE-JAVASCRIPT|", then what ever follows after can be read in as an adhoc query. This way, we can keep the code generic to all of the modules.

from corb2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.