Re: [expath] MongoDB Module: maps → strings?

Yes, Adam, I think XML would be easier. So it seems to me the chief candidates for representing JSON structures within function signatures are (a) a serialized JSON string, favoured by Christian, or (b) an XML equivalent.
Cheers,Hans-Jürgen
 


     Adam Retter <adam.retter@googlemail.com> schrieb am 11:53 Donnerstag, 26.März 2015:
   

 mongo:command($id, 'db', (
  function() {('createIndexes', 'coll')},
  function() {('indexes', '...')}
))

Basically instead of using a map of key-value pairs (which is just a
function from key->value), you use an array/sequence (which is
ordered) of functions which return key->value pairs. You could model
this in several different ways, for example another way would be:

mongo:command($id, 'db', function() {
  array {
    ('createIndexes', 'indexes'),
    function($key as xs:string) {
        switch($key) {
          case 'createIndexes':
              'coll'
          case 'indexes':
              ...
        }
    }
  }
})

I would abstract this structural pattern and provide functions to help
create it, as you will be nesting this to be able to create
effectively ordered maps of maps.

Although.... it might just be easier to use XML! :-)

-- 
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 Thursday, 26 March 2015 12:36:14 UTC