Page 1 of 1

Mongo error BadValue Unkown Operator

Posted: Sun Jan 24, 2016 11:36 pm
by Devin Normand

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


Mongo error BadValue Unkown Operator

Posted: Mon Jan 25, 2016 4:13 pm
by Serhii Kulibaba

Hello Devin,

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


Mongo error BadValue Unkown Operator

Posted: Wed May 18, 2016 5:28 pm
by Devin Normand

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.


Mongo error BadValue Unkown Operator

Posted: Wed May 18, 2016 5:43 pm
by Serhii Kulibaba

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...


Mongo error BadValue Unkown Operator

Posted: Fri May 20, 2016 6:03 pm
by Devin Normand

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?


Mongo error BadValue Unkown Operator

Posted: Mon May 23, 2016 9:11 am
by Serhii Kulibaba

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


Mongo error BadValue Unkown Operator

Posted: Mon May 23, 2016 8:15 pm
by Devin Normand

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


Mongo error BadValue Unkown Operator

Posted: Tue May 24, 2016 10:47 am
by Serhii Kulibaba

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


Mongo error BadValue Unkown Operator

Posted: Tue May 24, 2016 7:52 pm
by Devin Normand

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.


Mongo error BadValue Unkown Operator

Posted: Wed May 25, 2016 8:49 am
by Serhii Kulibaba

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