Questions tagged [mongodb-schema]

MongoDB Schema is used to validate if the incoming data is valid or not.

20 questions
0
votes
2 answers

How to create a MongoDB schema for excel file which can have arbitrary fields uploaded by user?

I am creating a rest api for excel. How can I create a MongoDB schema for excel file which can have arbitrary fields uploaded by user?
Udit Yadav
  • 99
  • 1
  • 7
0
votes
1 answer

How to updateMany many times within one function? MONGODB - Shell

As the question suggests, I have multiple columns which I would like to rename via shell. db.Hours.updateMany( {}, {"$rename" : {"season" : "Season"}}, ) db.Hours.updateMany( {}, {"$rename" :{"yr" : "Year"}} ) db.Hours.updateMany( {}, …
0
votes
0 answers

How to show actual values on MongoDB Compass Schema?

As the question suggests when analzing via Schema how does one view the actual number of records for a category rather than a percentage? For example I have daily records of totalRiders per hour with a season attribute, I have filtered for a Winter…
BoogieMan
  • 71
  • 1
  • 1
  • 6
0
votes
0 answers

MongoDb schema Design for role based access

I want to design a MongoDB schema where There are multiple roles There are multiple sites users are mapped to sites with multiple roles like image below The DB Schema is as below for Permission **permission** id …
rohit saraf
  • 37
  • 1
  • 8
0
votes
1 answer

Peer Based Validation in MongoDB Schema

I am using MongoDB Schema to validate the data inserted into the database. I would like to have peer based validation similar to Joi.when() in Joi. Here is how the data looks like: first:"Teddy", last:"Bear" How would I make last required and have…
CoderUni
  • 5,474
  • 7
  • 26
  • 58
1
2