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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:32:19+00:00 2026-05-25T20:32:19+00:00

Ok so I am coming from a mySQL background and am now trying to

  • 0

Ok so I am coming from a mySQL background and am now trying to rebuild a site using nodeJS and Mongoose. My old mySQL schema looked something like this (simplified):

users
  user_ID
  user_name
  user_email
  user_password

groups
  group_ID
  group_name
  group_description

groupusers
  groupuser_ID
  group_ID
  user_ID

comments
  comment_ID
  group_ID
  user_ID
  comment_txt

Can anyone suggest the best way to restructure this old mySQL schema to work with Mongoose?

  • 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-25T20:32:20+00:00Added an answer on May 25, 2026 at 8:32 pm
    users
      user_ID
      user_name
      user_email
      user_password
      Groups
         - grupid 1
         - grupid 2
         - grupid 3
    
    groups
      group_ID
      group_name
      group_description
      comments
        1 - 
           user_ID
           comment_txt
        2 -
           user_ID
           comment_txt 
    

    If you are worried about the comment size (currently mongodb max document size is 16 mb), you can move it to other doc

    In this way you can find the users of the group by

     db.users.find({Groups:'groupid1'})
    

    also the groups the user belongs to

       db.users.find({id:userid},{Groups:1})
    

    if you wanted to retrieve the group relevent info with the above query, i suggest you to store most frequently access group fields also with users.groups, like this

    users
      user_ID
      user_name
      user_email
      user_password
      Groups
         - { grupid 1,name}
         - {grupid 2,name}
         - {grupid 3,name}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am coming from MSSQL, and now using Mysql, this may be a easy
I am (as most ) coming from a mySQL background trying to switch over
Coming from a MySQL background I've been wondering for some time why a table
I'm coming from a MySQL background, and I'm interested in document-oriented databases, specifically CouchDB.
Im a bit new to T-SQL, Coming from a MySQL background Im still adapting
I am trying to show the data coming from mysql database as a table
I am trying to insert into mysql from an xml using PHP, but the
I am coming from a SQL server 2008 background. I have a mysql local
I am new to MySQL coming from Oracle. I have a requirement to create
I have a swing application that uses some datas coming from an external mysql

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.