javascript - How to create a JSON object with duplicate keys -


this question has answer here:

i'm working on sailsjs project , need create json object orm search work, how search should performed

venue.find({             is_published: true,             restaurant_services: {                 contains: '"delivery":"1"',                 contains: '"takeout":"1"'             },             restaurant_specialties: {                 contains: '"breakfast":"1"',             }         }).exec 

so may see json object inside find() 1 o need create , values inside has duplicate keys.

you can't. should try using instead:

venue.find({             is_published: true,             restaurant_services: {                 contains:  ['"delivery":"1"','"takeout":"1"']             },             restaurant_specialties: {                 contains: [ '"breakfast":"1"' ]             }         }).exec 

or this:

venue.find({             is_published: true,             restaurant_services: {                 contains: {"delivery":"1","takeout":"1"}             },             restaurant_specialties: {                 contains: { "breakfast":"1" }             }         }).exec