Page 1 of 1

query (or (and)(and));

Posted: Wed Aug 24, 2016 10:14 pm
by Nicklas

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?


query (or (and)(and));

Posted: Thu Aug 25, 2016 5:56 pm
by Evgene Karachevtsev

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


query (or (and)(and));

Posted: Mon Sep 05, 2016 1:39 pm
by Egor Kotov

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.