0

I am doing a research project on the JSON JSONIQ using Google App Engine and its Datastore. The Datastore is NoSQL so it is what I need for my JSON to work, but the problem is I am not able to export the datastore as JSON file. Also, I am using Java for the backend. Can please anyone guide on the process of exporting the datastore and using it as JSON for further JSONIQ query.

Thank you in advance.

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130

1 Answers1

-1

David,

I don't know if there is any way to use JSONIQ to grab data out of the datastore. I briefly reviewed their website and it's possible you could build a bridging layer between them once you actually have the JSON representation of the data. Appengine uses their own DSL which is called GQL (Google Query Language) to pull data out of the datastore.

To get the data out of the data store in JSON format I use objectify (a abstraction layer over the datastore API) to grab the needed entities I have and then I use Gson to convert them to their JSON representation. Hope this helps.

snielson
  • 69
  • 5
  • snielson,Thank you for the quick response. I am very new to the GAE and Java and I am researching further on them. One thing that I wasn't able to understand was that I have created the datastore in my console and want to use the database as JSON. In other post, they wrote we could convert the database as a Dictionary and further convert it to JSON. And I further want to create a JSONIQ page which would use the JSON "String" to extract data according to queries. – David Smith Dec 01 '15 at 21:05
  • Have you read the documentation on how to retrieve data from the datastore in java? This is the low level implementation (which is why I use objectify) https://cloud.google.com/appengine/docs/java/datastore/queries You can store your JSON as just a blob of string and pull it out from the database and just return it in your java servlet. If you've never done anything like this in java before I recommend going through the appengine tutorial: https://cloud.google.com/appengine/docs/java/gettingstarted/introduction – snielson Dec 01 '15 at 21:20
  • Also I was reading that the Google Datastore is NoSQL and since to make JSON format we require Database of NOSQL platform. Do we need to do anything to retrieve it as JSON though? Sorry for the questions, I am just learning. Thank you very much – David Smith Dec 02 '15 at 20:11
  • There's a lot of fundamentals that you appear to be missing. JSON is just a way of representing information and is independent of the backend storage system used. I've used JSON with SQL as well as NoSQL systems. If you are working with semi-structured data in the DataStore you will need to convert it to JSON, or pull your JSON documents out of the entities stored in the JSON. I recommend reading up on how the datastore works to give you a better understanding of the technology. – snielson Dec 03 '15 at 20:40