Hi
I’m testing out a Realm app with a database from Atlas.
I have a GET webhook exposing the entire database as an array, but need the database to be output in a single field as an animation loop sequence (like a stop watch counter.)
Here is the function I’m working on:
exports = function(payload) {
const mongodb = context.services.get("mongodb-atlas");
const mycollection = mongodb.db("mydatabase2").collection("mycollection2");
return mycollection.find({}, {_id:0}).toArray();
};
and the webhook database output as static array, instead of animation loop.
Please help, I am still learning) and would love to make use of MongoDBxRealm apps properly!
Many thanks, Andi
PS
So instead of exposing the entire database as a static array:
[{"id":"214"},{"id":"301"},{"id":"2110"},{"id":"152"}]
The webhook will loop through the database infinitely as an animated sequence shown as a single field:
[{"id":"214"}]
Thank you!