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 5973875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:51:44+00:00 2026-05-22T20:51:44+00:00

with mongodb and rest activated, i would like to query a document inside another

  • 0

with mongodb and rest activated, i would like to query a document inside another document, what is the syntax ? In my exemple, I have a Person collection which contains an Order document for each Person.

Ex, I have this schema

public Person{
    public int Id {get;set;}
    public IList<Order> Order {get;set;}
}

public Order{
    public int Id {get;set;}
    public string OrderName {get;set;}
}

If I want to query the person with Id = 2, I just need to type this URL:

http://localhost:28017/MyDatabase/PersonCollection/?filter_Id=2

But what If I want to query the Order with Id = 40 ?

http://localhost:28017/MyDatabase/PersonCollection/?filter_Order.Id=40

But It doesn’t work, it returns all the orders without my filter by Id=40.

What’s the solution ?

Thanks
John

  • 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-05-22T20:51:45+00:00Added an answer on May 22, 2026 at 8:51 pm

    Syntax the same as usual, so following request should work:

    http://localhost:28017/MyDatabase/PersonCollection/?filter_Order.Id=40
    

    But yout document should looks like this:

    {
      "_id": 1,
      "Order": [
        {
          "Id": 40,
          "OrderName": "name"
        }
      ]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In MongoDB I have a collection of documents called 'clients', where each document is
I'd like to use the standard MongoDB ReST interface ( http://www.mongodb.org/display/DOCS/Http+Interface ) to search
While doing an async mongodb query like the one in the below class how
I have a MongoDB collection and need to find the max() value of a
I am running MongoDB in the REST mode and trying to get query results
MongoDB seems like it is using an inefficient query pattern when one index is
MongoDB Question: I would like to find similar bookmarks of other users. Let's say
is mongodb appropriate for sites like stackoverflow?
I have launch mongodb server: [demas@arch.local.net][~]% mongod --dbpatmongod --dbpath /home/demas/temp/ Mon Apr 19 09:44:18
All of us have come across the recent hype of no-SQL solutions lately. MongoDB,

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.