Xquery with MongoDB

1,145 views
Skip to first unread message

Roman Zimine

unread,
Jul 5, 2012, 9:02:47 PM7/5/12
to mongod...@googlegroups.com
Hello,

We a storage service used by other applications. Currently we're using an XML database for the storage service, storing XML and letting the other applications query it using XQuery. I'm prototyping using MongoDB instead. The storage is fairly straightforward if we convert XML to JSON. However, the querying is not as straightforward because we don't have control over the queries. Is there a way to dynamically transform XQuery queries into Mongo-compatible queries? The folks here (http://www.28msec.com/html/entry/2011/10/06/Sausalito_14) seem to do something along those lines, though it's not exactly what we're looking for.

Thanks in advance!

Stephen Steneker

unread,
Jul 8, 2012, 11:26:05 PM7/8/12
to mongod...@googlegroups.com
We a storage service used by other applications. Currently we're using an XML database for the storage service, storing XML and letting the other applications query it using XQuery. I'm prototyping using MongoDB instead. The storage is fairly straightforward if we convert XML to JSON. However, the querying is not as straightforward because we don't have control over the queries. Is there a way to dynamically transform XQuery queries into Mongo-compatible queries? The folks here (http://www.28msec.com/html/entry/2011/10/06/Sausalito_14) seem to do something along those lines, though it's not exactly what we're looking for.

Hi Roman,

It looks like 28msec are using (and contributing to) the Zorba XQuery Processor, which appears to have support for XQuery => JSON (and MongoDB as a data store):

I didn't come across any clear tutorials of using this with MongoDB so it would be great to share your findings in a blog post :).

Cheers,
Stephen

Roman Zimine

unread,
Jul 9, 2012, 7:17:16 PM7/9/12
to mongod...@googlegroups.com
I did look into it a little but, but decided that there are alternative ways of dealing with the situation without trying to dynamically use XQuery for MongoDB. Now I only have to worry about using the MongoDB Query Language to access the ugly JSON that results from lossless XML-JSON conversion >.< Thanks though!
Reply all
Reply to author
Forward
0 new messages