Nicklas
Posts: 0
Joined: Thu Jul 03, 2014 8:51 am

query (or (and)(and));

Hi!
This thing was to hard to search for so I just have to post this question.

I have a Query to my database with the following code who works perfectly:

codevar createdByID = gets value from localStorage...
return '{"$and": [{"createdByID":"'+currentIDMe+'"},{"sentToID":"'+value+'"}]}';/code

But I want it to do this:

codereturn '{"$and": [{"createdByID":"'+currentIDMe+'"},{"sentToID":"'+value+'"}]}'/code
OR
code'{"$and": [{"createdByID":"'+sentToID+'"},{"currentIDMe":"'+value+'"}]}';/code

So I want it do be like: code$or [{first line above},{second line above}];/code

I tried different ways my self but didn't make it.

Could someone give me the code for have to make that work?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

query (or (and)(and));

Hello Nicklas,

Unfortunately custom JS code is outside the scope of standard Appery.io platform support. You may consider purchasing Advisory Pack to get more in-depth help on this question. Here is more information about it: http://appery.io/services/#Advisory_Pack

Egor Kotov
Posts: 0
Joined: Mon Mar 31, 2014 5:06 pm

query (or (and)(and));

Hello Nicklas,
I just build a simple query generator for simple and/or queries.
http://blog.bismallion.com/appery-db-...
At least, you can test each part of your query, cause right now it generates simple ones.

Return to “Issues”