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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:24:37+00:00 2026-06-17T07:24:37+00:00

I have A Mongodb database structure below, I would like to add a list

  • 0

I have A Mongodb database structure below, I would like to add a list of picture into the structure :

{
    "_id": "50d3dbce1292dd2e98af1dd1",
    "Name": "Bubba",
    "Address": "1111",
    "Loc": {
        "Lon": 11.0000,
        "Lat": 3.113005
    },
    "Pic" : [{"Name": "test1.jpg", "Size":"1000"}, {"Name": "test2.jpg", "Size":"2000"}],
    "LastModified": {
        "$date": "2012-12-21T03:47:26.535Z"
    }
}

My model:

public class Test
    {
        [BsonId]
        public string Id { get; set; }
        public string Name { get; set; }
        public string Address { get; set; }
        public Location Loc { get; set; }
        public Picure Pic {get; set; }
        public DateTime LastModified { get; set; }
    }

    public class Location
    {
        public double Lon { get; set; }
        public double Lat {get; set;}
    }

    public class Picture
    {
        public string Name{ get; set;}
        public int Size {get; set;}
    }

Is my design for array of picture model correct?

  • 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-17T07:24:38+00:00Added an answer on June 17, 2026 at 7:24 am

    In your document Pic is an array. So, you should declare you Pic property as List<Picture>

    public List<Picture> Pic {get; set; }
    

    Also there is an error in your json:

    {"Name", "test1.jpg", "Size":"1000"}
    

    but should be

    {"Name": "test1.jpg", "Size":"1000"}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly straight forward database structure I would like to create with
I have a SQL database with two tables like this: Users Id (PK) Name
Say I have a MongoDB collection with documents like— { name: Hawaiian, toppings: ['cheese',
I am using mongoDB database. in which I have collection in below format. {
I have created a mongodb database. I have a list of clients who are
I have a system that stores data into a MongoDB database. Now I need
I have a MongoDB database with documents that look like this: {users : [u1,
I have an application using a MongoDB database and am about to add custom
I have a few objects in a MongoDB database where the _id field was
Rails 3.2.1 app name: demo database: mongoDB with mongoid I have this scaffolding set

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.