Hi, I have two MongoDB Realm apps that have the same versions but when I execute something in a function the returned object types differ.
Versions:
Atlas: 4.4.10
Server Version: 4ab8d0db70
UI Version: 4.37.4
JS SDK Version: 3.18.0
Code:
const db = context.services.get("mongodb-atlas").db("divtracker");
const transactionsCollection = db.collection("transactions");
const promise = transactionsCollection.find({}).toArray();
console.log(`Promise: ${JSON.stringify(promise)}`);
According to the documentation promise
should be a Promise
. That’s true for one of my Realm apps but for another, the actual result is an array. The question is: what’s going on?
Expected result:
Promise: {}
Actual result:
Promise: [{...},{...},...]