2

BaseX focuses on storing, querying, and visualizing large XML and JSON documents and collections.

Is there any way to query MongoDB documents and use BaseX visualizing ability?

Handsome Nerd
  • 17,114
  • 22
  • 95
  • 173
  • Have you tried the JSON module? – WiredPrairie May 18 '13 at 19:37
  • @WiredPrairie No. Can it send query to MongoDB server? – Handsome Nerd May 18 '13 at 19:42
  • 1
    Not directly (at least not in a straightforward way). It's really designed for XML, so JSON needs to be transformed into XML. http://docs.basex.org/wiki/JSON_Module – WiredPrairie May 18 '13 at 20:17
  • Use the JSON module like WiredPrairie proposed and have a look at the different [MongoDB-Rest-Wrappers proposed in this question](http://stackoverflow.com/questions/7386740/does-mongodb-has-a-native-rest-interface), so you can use BaseX' HTTP module to connect to MongoDB. – Jens Erat May 18 '13 at 20:55
  • Just to complement this. We are currently working on the specification of an XQuery MongoDB Module: http://expath.org/spec/mongo. – Christian Grün Apr 12 '15 at 09:37

1 Answers1

0

Let me try to help, the information comes from: http://docs.basex.org/wiki/JSON

Example: Converts a JSON string with simple objects and arrays Query:

json:parse('{
 "title": "Talk On Travel Pool",
 "link": "http://www.flickr.com/groups/talkontravel/pool/",
 "description": "Travel and vacation photos from around the world.",
 "modified": "2014-02-02T11:10:27Z",
 "generator": "http://www.flickr.com/"
 }')

Result:

 <json type="object">
   <title>Talk On Travel Pool</title>
   <link>http://www.flickr.com/groups/talkontravel/pool/</link>
   <description>Travel and vacation photos from around the world.    </description>
   <modified>2014-02-02T11:10:27Z</modified>
   <generator>http://www.flickr.com/</generator>

Antonio López Ruiz
  • 1,396
  • 5
  • 20
  • 36