MongoDB Module: maps → strings?

Dear EXPath followers,

Thanks for the feedback on our MongoDB module [1]! The general
reactions on the current working draft were all positive, but we
stumbled upon a potential show stopper:

In our module, we initially decided to use XQuery maps and arrays for
representing JSON structures. Unfortunately, it turned out there are
at least some MongoDB functions – such as mongo:command – that require
map entries to be ordered (!). However, map entries in XQuery have no
order, which means that we need to rethink our current design. We
currently see the following alternatives:

1. Use JSON strings, as proposed in Dannes' initial Mongrel implementation,
2. Use XML representations of JSON structures, such as the one
generated via fn:json-to-xml,
3. Ensure order of map entries by wrapping them in additional
sequences or arrays.

We are currently trying to find out which fallback causes least
headache, but we are also interested in your thoughts. Let us know
what you think!

Christian

[1] http://expath.org/spec/mongo

Received on Wednesday, 25 March 2015 23:39:09 UTC