HI
I have been trying to get the MongoDB Charts to only show data relevant to the organisation logged into the app. I have the JWT token being passed to the Charts SDK and that is all working great, however, because the field is a ObjectId, no results are being returned.
To make sure it was not the JWT I have tried hard coding a value in different ways to see if I can get it to work, none are successful.
// This should work, if we have access to ObjectId method.
function getFilter(context) {
return {organisationId: ObjectId("123")
}
// This does not work (kinda expected I guess)
function getFilter(context) {
return {organisationId: "123")
}
// No longer a valid query?
function getFilter(context) {
return {organisationId: {"$oid": "123"})
}
Anyone got any suggestions or have I missed something very obvious somewhere?
Thanks
Mike