Compare mongoDB values with array
up vote
0
down vote
favorite
I have MongoDB collection like,
'key1':
'key2' : 'value1'
'key3' : 'value2'
I am getting an array of values using API like
values = ['value1', 'value2', 'value3']
I want get the documents which has at least one of the values in values array. In short, need to check if the value of key1: value1 is present in array values.
How it can be achieved by MongoEngine?
mongodb mongoengine flask-mongoengine
add a comment |
up vote
0
down vote
favorite
I have MongoDB collection like,
'key1':
'key2' : 'value1'
'key3' : 'value2'
I am getting an array of values using API like
values = ['value1', 'value2', 'value3']
I want get the documents which has at least one of the values in values array. In short, need to check if the value of key1: value1 is present in array values.
How it can be achieved by MongoEngine?
mongodb mongoengine flask-mongoengine
you want to check if values array's element exist in key1>key2 or key3 > values, right ?
– Alok Deshwal
Nov 10 at 16:14
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have MongoDB collection like,
'key1':
'key2' : 'value1'
'key3' : 'value2'
I am getting an array of values using API like
values = ['value1', 'value2', 'value3']
I want get the documents which has at least one of the values in values array. In short, need to check if the value of key1: value1 is present in array values.
How it can be achieved by MongoEngine?
mongodb mongoengine flask-mongoengine
I have MongoDB collection like,
'key1':
'key2' : 'value1'
'key3' : 'value2'
I am getting an array of values using API like
values = ['value1', 'value2', 'value3']
I want get the documents which has at least one of the values in values array. In short, need to check if the value of key1: value1 is present in array values.
How it can be achieved by MongoEngine?
mongodb mongoengine flask-mongoengine
mongodb mongoengine flask-mongoengine
asked Nov 10 at 14:03
chetan tamboli
66
66
you want to check if values array's element exist in key1>key2 or key3 > values, right ?
– Alok Deshwal
Nov 10 at 16:14
add a comment |
you want to check if values array's element exist in key1>key2 or key3 > values, right ?
– Alok Deshwal
Nov 10 at 16:14
you want to check if values array's element exist in key1>key2 or key3 > values, right ?
– Alok Deshwal
Nov 10 at 16:14
you want to check if values array's element exist in key1>key2 or key3 > values, right ?
– Alok Deshwal
Nov 10 at 16:14
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239736%2fcompare-mongodb-values-with-array%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
you want to check if values array's element exist in key1>key2 or key3 > values, right ?
– Alok Deshwal
Nov 10 at 16:14