Read Data
Fetch All Documents from a Collection
Fetch All Documents from a Collection in WorqDB
You can fetch all documents that are present in a Collection:
Before you begin
See Get started with Create Collections to create a Collection before you add data to it.
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').getAll().then((response) => {
console.log(response.data);
}).catch((error) => {
console.log(error);
});
Was this page helpful?