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 9167231

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:20:22+00:00 2026-06-17T15:20:22+00:00

I use mongodb + node.js + mongoose.js ORM backend. Let say I I have

  • 0

I use mongodb + node.js + mongoose.js ORM backend.

Let say I I have some nested array of object without _id field

mongoose.Schema({
  nested: [{
    _id: false, prop: 'string'
  }]
})

And then I want to ad _id field to all nested objectds, so the mongoose schema would be

mongoose.Schema({
  nested: [{
    prop: 'string'
  }]
})

Then I should run some script to modify production DB, right? What is the best way to handle such change? Which tool (or approach) is best to use to implement the change?

  • 0 0 Answers
  • 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-17T15:20:23+00:00Added an answer on June 17, 2026 at 3:20 pm

    One of the significant advantages of schema-less databases is that you don’t have to update the entire database with new schema layouts. If some of the documents in the DB don’t have particular information, then your code can do the appropriate thing instead, or elect to now do anything with that record.

    Another option is to lazily update the documents as required – only when they are looked at again. In this instance, you might elect to have a per-record/document version flag – which initially may not even appear (and thus signify a ‘version 0’). Even that is optional though. Instead, your database access code looks for data it requires, and if it does not exist, because it is new information, added after a code update, then it would fill in the results to the best of its ability.

    For your example, converting an _id:false into a standard MongoId field, when the code is read (or written back after an update), and the _id:false is currently set, then make the change and write it only when it is absolutely required.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some problem with this mongoid. It's my first time to use mongoDB,
i have deep nested arrays, i am trying to group by some nested array
I've been evaluating Mongoose (an ORM for node.js which uses MongoDB for persistent storage).
I'm using the node-mongodb-native driver with MongoDB to write a website. I have some
I have a good reason to use MongoDB for part of my app. But
I am trying to learn how to use Node, Mongoose, and Mongo by looking
I am trying to use GridStore of mongodb, I have a wierd infinite loop
First of all, I am new to Node.js and MongoDB. I have an idea
Intending to log use of the API (user/route/params/time) in a Heroku/Node/Express/Mongodb web app, to
I want to use MongoDB and Node.js in my project. What I need is,

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.