Sorry, complete new person, apologies for errors in posting. I’ve read the support documentation re EJSON, but can’t make it work. This is a simple function, accesses a collect and returns JSON. I was trying to make it regular JSON , but it’s only working for me with extended JSON.
// This function is the endpoint's request handler.
exports = function({ query, headers, body}, response) {
const {email, password} = query;
const doc = context.services.get("mongodb-atlas").db("xxxx").collection("xxxxxxxx");
bobQ = {"email": {$eq: email}, "password": {$eq: password}}
const responseCall = doc.findOne(bobQ);
return JSON.stringify(responseCall);
// return responseCall;
};
This is returned without stringify, with stringify, “{}” is returned:
{
"_id": {
"$oid": "6215f8344fbd568f13ba6bbb"
},
"userId": {
"$numberInt": "18"
},
"email": "xxxxx@outlook.com",
"subscription": {
"type": {
"$numberInt": "0"
}
},
"password": "awe43es"
}