-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making an EXPath module? #35
Comments
To complement this: In 2012/13, this has been the Zorba approach to integrate MongoDB: |
Hi Christian, yes I would be certainly be interested in aligning the works, and join forces; I am actually developing a Couchbase driver as well, so your message pos in on the right moment :-) |
Here are two simple examples of our MongoDB connector (which was inspired by the Java driver. It looks pretty similar to your approach: (: Example 1: List all database entries. :)
import module namespace mongo = 'http://basex.org/modules/mongodb';
(: Could potentially be extended to multiple server addresses :)
let $mongo-id := mongo:connect('localhost', 27017)
return (
for $db-id in mongo:dbs($mongo-id)
for $coll-id in mongo:collections($db-id)
return mongo:find($coll-id),
(: optional: connection will automatically be closed after query execution :)
mongo:close($mongo-id)
)
(: Possible result: :)
map { "_id": 1, "name" : "eXist-db" },
map { "_id": 2, "name" : "BaseX" },
map { "_id": 3, "name" : "Saxon" },
map { "_id": 4, "name" : "Zorba" },
map { "_id": 5, "name" : "Qizx" } (: Example 2: Find specified collection entry. :)
import module namespace mongo = 'http://basex.org/modules/mongodb';
let $mongo := mongo:connect('localhost')
let $db := mongo:db($mongo, 'database')
let $coll := mongo:collection($db, 'collection')
return mongo:find($coll, map { '_id': 1 }) We have no critical applications for this module so far, and you said you are already working on the second version, so we could further align it with your function signatures. |
Ok I'll dive into it; most of the signatures are documented in the wiki, and have xquery test: https://github.com/dizzzz/Mongrel/tree/develop/java/test/src/org/exist/mongodb/test/db ; the tests marked with _xq31 indicate xquery31 compatible tests.... |
Hi Dannes, I've just discovered your MongoDB module for eXist-db. We've done a similar module recently, based on XQuery maps and arrays; maybe we can join forces and make an EXPath module out of it? Would you be interested?
The text was updated successfully, but these errors were encountered: