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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:09:55+00:00 2026-06-02T10:09:55+00:00

I am aware of several approaches to versioning individual documents in a MongoDB server.

  • 0

I am aware of several approaches to versioning individual documents in a MongoDB server. I’d like, however, to add both versioning of individual documents and versioning of entire sets. I.e. if document A changes from version 1 to 2, I’d also like to know what when A is at version 2, what versions are documents B, C, D, etc.

The underlying goal here is data provenance. Say I have a query Q on a set of documents D, generating result R. I’d like to save D+Q=R, so when D becomes D’ because a document has changed, I have D’+Q=R’.

Anythoughts on the best strategy for doing this in MongoDB? I can keep separate documents that has versions of all other documents, but that seems very expensive to run queries against. I can use timestamp rather than versions, which may work okay. Are there supports for this kind of thing in MongoDB that I am not aware of?

Thanks.

  • 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-02T10:10:09+00:00Added an answer on June 2, 2026 at 10:10 am

    There’s no specific support for a feature like this in MongoDB, you’ll have to implement it in your application code. It sounds like you have a denormalization pattern: R is effectively a cache of Q that you must invalidate when D changes. You can either do this invalidation synchronously, when you update any documents in D, or you can install some task queue (e.g. RabbitMQ) and insert a task into it whenever you change D, and have a background process pull tasks from the queue. The background process then updates R. The specific implementation depends on how consistent you need R to be.

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

Sidebar

Related Questions

Context I am aware of http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/editor/equationeditor.html# However, when I try it, it does not
I'm aware of several question on this forum relating to this. But I'm not
I'm aware that questions about the stack vs. the heap have been asked several
I am aware of several open source java libraries that will convert XML to
I’ve got several iOS apps and I need them to be aware of each
Ok guys I am completely aware this question has been asked on several sites
I'm aware of a few tools that indicate which individual classes are coupled to
I have a scroll view which contains several objects like text fields,labels,switch etc..Now as
I have recently become aware that our code has several implementations of a version
I need to build several Rails applications for one client. I would like to

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.