Re: [expath] MongoDB Module: Working Draft

Hi Christian,
very glad that index management is at any rate enabled, one way or another! I would still vote for explicit functions, but this is not a critical issue.

Something you wrote puzzles me:"I am not quite sure on this one: If someone is not interested in the
"write result" of an update operation, this result would need to be
explicitly ignored in some way in the XQuery expression. What do you
think would be the most elegant way to write an updating MongoDB query
without returning any result as query output?"
Could you give an example where a non-empty value of the function call might disturb the client? If he is not interested, he either does not assign the value to a variable, or, if the call is within a let or for clause, simply does not use the bound variable. I just have not yet understood the issue.
And I have a very general question concerning the order of evaluations in a "for" expression. In principle, I thought, the processor is free to choose any evaluation order as long as the dependencies implied by "return value of expr#1 = input value expr#2" is respected (i.e., expr#1 is guaranteed to be resolved before expr#2). Therefore I wonder about FLWOR clauses using expressions with a value which is statically known to be an empty sequence - can I still rely on any order? This may of course be crucial in case of side-effects, as there are with mongo (or SQL) updating expressions.

Cheers,Hans-Jürgen
 

     Christian Grün <christian.gruen@gmail.com> schrieb am 23:15 Montag, 9.März 2015:
   

 Hi Hans-Jürgen,

Thanks for your initial feedback (and thanks to others writing me in
private.. If possible, please always write to the list!).

> index management

In my opinion, the addition of these functions would make sense and
should be pretty straightforward (but I can also relate to Dannes'
perspective on this). By the way, right now you can also us
mongodb:command for handling indexes [1].

> mongodb:update / return value

I am not quite sure on this one: If someone is not interested in the
"write result" of an update operation, this result would need to be
explicitly ignored in some way in the XQuery expression. What do you
think would be the most elegant way to write an updating MongoDB query
without returning any result as query output?

> mongodb:find / options
> However, supposing that the XQuery function is equivalent to
> db.collection.find(), the _id field can be suppressed by the "fields" entry
> "_id: 0"

Thanks for the hint! This comment should simply be dropped.

> Later, the spec might perhaps for each mongodb function specify
> the equivalence of functionality provided by the function on one
> hand, and a well-defined MongoDB operation on the other hand

This would be nice indeed. However, my personal experience so far is
that the existing MongoDB API is not as consistent and stable as we
wish it should be, at least not in its current state, so I assume that
if we aligned our module more closely to the current API, we would
arguably need to update this module more frequently as we would like
to.

Surprisingly, I noticed that even the official MongoDB Java driver
(which we and eXist use in our implementations) differs from the shell
API in various aspects, often more than our own driver does, and I'm
not even fully sure if we could map all features of the MongoDB shell
API with this driver.

More feedback is welcome,
Christian

[1] http://docs.mongodb.org/manual/reference/command/createIndexes/#dbcmd.createIndexes

-- 
You received this message because you are subscribed to the Google Groups "EXPath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to expath+unsubscribe@googlegroups.com.
To post to this group, send email to expath@googlegroups.com.
Visit this group at http://groups.google.com/group/expath.
For more options, visit https://groups.google.com/d/optout.

   

Received on Wednesday, 11 March 2015 11:23:57 UTC