Devin Normand
Posts: 0
Joined: Tue May 19, 2015 11:29 pm

Mongo error BadValue Unkown Operator

Hello Friends!

We are getting a weird error after trying to add this code, and are wondering what we are doing wrong:

var staridvar = localStorage.getItem("userprofileid");
var whereObject = {"userprofileid": {"$inQuery": {_id: staridvar } }};
return JSON.stringify(whereObject);

Error:
code: "DBSQ272"
description: "Mongo error: 'Can't canonicalize query: BadValue unknown operator: $inQuery'"

Keep rocking,
DN

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Mongo error BadValue Unkown Operator

Hello Devin,

Please use Quotation marks in the request parameters as it is shown here: https://devcenter.appery.io/documenta...

Devin Normand
Posts: 0
Joined: Tue May 19, 2015 11:29 pm

Mongo error BadValue Unkown Operator

Hello there Sergiy,

Do you have any idea about why this code works:

var staridvar = localStorage.getItem("starid");
var whereObject = {"staridid": {"$inQuery": {_id: staridvar } }};
return JSON.stringify(whereObject);

And this one returns with the DB error:

var userprofvar = localStorage.getItem("userprofileid");
var whereObject = {"userprofileid": {"$inQuery": {_id: userprofvar } }};
return JSON.stringify(whereObject);

They seem the exact same to me, other than the local storage variable they are both trying to get.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Mongo error BadValue Unkown Operator

Hello Devin,

Please use prevar whereObject = {"staridid": {"$inQuery": {"id": staridvar } }}; /pre instead of: prevar whereObject = {"staridid": {"$inQuery": {id: staridvar } }}; /pre

See example here: https://devcenter.appery.io/documenta...

Devin Normand
Posts: 0
Joined: Tue May 19, 2015 11:29 pm

Mongo error BadValue Unkown Operator

For whatever reason, the code is still returning the same response:

"Mongo error: 'Can't canonicalize query: BadValue unknown operator: $inQuery'"
Name

Here is the code:

var userprofvar = localStorage.getItem("userprofileid");
var whereObject = {"userprofileid": {"$inQuery": {"_id": userprofvar } }};
return JSON.stringify(whereObject);

Is there anything else clearly wrong?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Mongo error BadValue Unkown Operator

Please provide us with a public app link (https://devcenter.appery.io/documenta...) and exact steps to reproduce this problem.

Devin Normand
Posts: 0
Joined: Tue May 19, 2015 11:29 pm

Mongo error BadValue Unkown Operator

Ok:
http://appery.io/app/mobile-frame?src...

Just press 'login', and the userprofile screen will show up, and I gave the test user a profile

Thank you!

DN

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Mongo error BadValue Unkown Operator

Please clarify, what type does column "userprofileid" have?

Devin Normand
Posts: 0
Joined: Tue May 19, 2015 11:29 pm

Mongo error BadValue Unkown Operator

It is a pointer. Do you think the error could be due to a listing service problem? I do not know where to put the $ in the success part of the list service.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Mongo error BadValue Unkown Operator

It should work fine. Please share (http://devcenter.appery.io/documentat...) your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a and provide us with the following information:

1) App name
2) Test credentials if login functionality is implemented in your app
3) Detailed steps to reproduce the issue

Return to “Issues”