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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:37:34+00:00 2026-06-01T07:37:34+00:00

Imagine I have a document like this: post = {title: a, comments: [{hour: 08:00,

  • 0

Imagine I have a document like this:

post = {title: "a", comments: [{hour: "08:00", "text": "abc"}, {hour: "09:00", "text": "def"}]}

Now I might have about 1000 posts and each have 100 comments, that means we have around 100000 comments,

  • but how I might find which is the most common hour that a comment is made?
  • It’s even possible to keep up to 100, or 1000 comments for example?
  • Get all the users comments? I might make an array on the user document with comments = […]?
  • I see they have not a _key property, but I would like to use one, is possible without implementing my own key gen system?
  • It’s possible to have a collection with comments and keep them there too?

Another example would be:

 article = {code: "X900123", quantity: 24, movementsHistory: [{date:20120101, quantity: 3}, {date:20120102, quantity: 5}]}

how this could be made if I would want all the movements for all the articles made on 20120101 that were bigger than 25% of the current stock?
– In mysql I would have a table for articles and movements, then each movement is linked to the article. Therefore I could make a join on articles and movements and get the results. (about all articles, not one by one)

thanks for help (:

  • 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-01T07:37:35+00:00Added an answer on June 1, 2026 at 7:37 am

    Okay, many questions here.

    1. Use MapReduce.
    2. 100 most common comments? Yes, it’s possible, use MapReduce.
    3. You can copy comments to user document, yes. Or you could use MapReduce.
    4. No need to make your own id generator. All official drivers support creation of new ObjectIds (on the client, without contacting server).
    5. That would the most reasonable solution here, because you want to treat comments as a first class entity, not an embedded one. You should not embed a first-class entity, it’ll make things harder. If comments have their own collection, you have more freedom in possible queries that you can run. Here’s more information on “embed vs. link”.

    Your second example I didn’t really understand.

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

Sidebar

Related Questions

Imagine I have table like this: id:Product:shop_id 1:Basketball:41 2:Football:41 3:Rocket:45 4:Car:86 5:Plane:86 Now, this
I have some data which I am formatting like this: // ... imagine populating
I have this code inline in document ready if($.cookie('form_seen') == null) { $(#dialog_form).dialog(open); }
Imagine a URL like this: http://hostname/a/b/xy-00:11:22:33:44:55-/c I would like to put an .htaccess file
I think this is a simple question. Imagine you have a page that initializes
I have this code: $(document).ready(function() { var url = https://graph.facebook.com/search?q=cinema&type=post; $.ajax({ type: POST, url:
Imagine the HTML is like this: <a id=tour_gallery_link href=#>Click Me</a> <div id=tour_gallery> <a href=image1.png><img
I feel like this must have been asked, but I'm unable to find it
Imagine we have a program trying to write to a particular file, but failing.
Imagine I have an function which goes through one million/billion strings and checks smth

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.