1

How MongoDB Stitch 3rd Party Services return JSON Array Object? My return it's showing EJSON with $ (dollar sign). Someone can help me ?

return mycollection.findOne({"_id": BSON.ObjectId(id)});

response e.g.: cost: {$numberDouble: "65"}

I need e.g.: cost : 65

1 Answers1

0

See: https://docs.mongodb.com/realm/mongodb/actions/collection.find/

To create an array try:

return mycollection.find({"_id": BSON.ObjectId(id)}).toArray();

To resolve issue with numberDouble see: MongoDB Stitch returns data as $NumberDouble instead of the number itself

Mr. J
  • 307
  • 2
  • 9