Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8636437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:13:53+00:00 2026-06-12T10:13:53+00:00

If my stored document looks like this: doc = { ‘Things’ : [ ‘one’

  • 0

If my stored document looks like this:

doc = {
    'Things' : [ 'one' , 'two' , 'three' ]
    }

How can I query for documents which contain one in Things?

I know the $in operator queries a document item against a list, but this is kind of the reverse. Any help would be awesome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:13:54+00:00Added an answer on June 12, 2026 at 10:13 am

    Use MongoDB’s multikeys support:

    MongoDB provides an interesting “multikey” feature that can automatically index arrays of an object’s values.
    […]

    db.articles.find( { tags: 'april' } )
    {"name" : "Warm Weather" , "author" : "Steve" , 
     "tags" : ["weather","hot","record","april"] , 
     "_id"  : "497ce4051ca9ca6d3efca323"}
    

    Basically, you don’t have to worry about the array-ness of Things, MongoDB will take care of that for you; something like this in the MongoDB shell would work:

    db.your_collection.find({ Things: 'one' })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to store data that looks like this: <root> <child-one> value 1 value
I have an XML document that looks like this: <?xml version=1.0 encoding=UTF-8?> <xs:msgdata xmlns:xs=http://www.myCompany.com
I have some code that looks like this: document.getElementById(error).style.display = 'block'; and when this
I have an XML document that looks like this: <?xml version=1.0 encoding=utf-8?> <Schema Namespace=EDIManagement.Models.Store
By default settings are stored at: C:\Documents and Settings\\Local Settings\Application Data\<Project Name> How can
My dictionary looks like this: docScores = {0:[{u'word':2.3},{u'the':8.7},{u'if':4.1},{u'Car':1.7}], 1:[{u'friend':1.2},{u'a':5.2},{u'you':3.8},{u'person':0.8}], ... 29:[{u'yard':1.5},{u'gardening':2.8},{u'paint':3.7},{u'brush':1.6}] } I want
I have a model that looks like this: class Pdf extends \lithium\data\Model { protected
I have an xml file that looks like this: <args> <sometag value=abc /> <anothertag
hey there, I have a Navigation Menu and my code looks like this.. <ul
I have a function in R that looks somewhat like this: setMethod('[', signature(x=stack),definition=function(x,i,j,drop){ new('class',

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.