skip to Main Content

Updating value in a nested document in mongoDB

I have the following schema: const itemsSchema = new mongoose.Schema({ name: String, checkedValue: String }); const listSchema = new mongoose.Schema({ name: String, items: [itemsSchema] }); I want to update data like this: listSchema>items>checkedValue. I have performed the following operation: db.collections.update({…

VIEW QUESTION

Can’t access ‘skills’ in MongoDB?

const skillsSchema = { title: String, description: String, }; const Skill = mongoose.model('Skill', skillsSchema); const teacherSchema = { profession: String, teacherFName: String, bornDate: Number, priceperhour: Number, videolink: String, email: String, password: String, skills: [skillsSchema], }; const Teacher = mongoose.model('Teacher', teacherSchema);…

VIEW QUESTION

How can I rewrite this?

Currently I am trying to write RESTapi for a website with users and flashcards. I am using a MERN stack in order to build this. The mongodb structure is the following: //FlashCardSchema const flashcardSchema = new Schema({ deckID: { type:…

VIEW QUESTION

How can we rewrite this?

Currently I'm using a timer with node-schedule to check for changes in the database, making queries every 1 minute and then comparing with the information already registered to see if there were changes since the last check. With what I…

VIEW QUESTION
Back To Top
Search