We now let you run the most Complex Queries by just passing in your Collection Name and a Natural Language Query to fetch the data you need.

Some examples of the queries you can run are:

  • Fetch all documents in a collection
  • Fetch all documents in a collection where a field is equal to a value (You can describe the field and value in any way you want)
  • Fetch all documents in a collection where a field is equal to a value and another field is equal to another value
  • Fetch all documents in a collection where a field is equal to a value and sort the results by another field
  • Fetch all documents in a collection where a field is equal to a value and sort the results by another field and limit the results to a certain number

Initialize Database Modules

const worqhat = require('worqhat');

var config = new worqhat.Configuration({
    apiKey: "your-api-key",
    debug: true,
    max_retries: 3,
});

worqhat.initializeApp(config);

let db = worqhat.database();

Example

db.collection('NodeJSDb1').language("get me the average age of all the people").get().then((response) => {
    console.log(response);
}).catch((error) => {
    console.log(error);
});