Linked Questions
10 questions linked to/from Mongoose delete array element in document and save
1
vote
2
answers
1k
views
Mongoose - How To Remove Object From Array Element [duplicate]
A user has the ability to add languages. languages are stored as an array of type teach or learn in the userschema. I can simply add a language to the languages.teach[] by using push, but how do i ...
1
vote
3
answers
88
views
How to remove an element from an array in js [Elements are from mongodb] [duplicate]
The following is my array,
[
{
"key_id": "#K000030",
"_id": "K000030",
"isMaster": true,
"specialties": [
{
"speciality1_count": "x039",
"speciality1"...
224
votes
6
answers
251k
views
How to remove array element in mongodb?
Here is array structure
contact: {
phone: [
{
number: "+1786543589455",
place: "New Jersey",
createdAt: ""
}
{
number: "+...
1
vote
3
answers
2k
views
How to delete an element of an array in a JSON Object with Mongoose?
I have already checked the following stackoverflow questions:
Mongoose delete array element in document and save
How to remove array element in mongodb?
Here is what I tried:
var User = require('../...
2
votes
1
answer
1k
views
Accessing object in array of arrays using mongoose
I have the following structure and am trying to remove an object in participants (league.division.participants).
var participantSchema = new mongoose.Schema({
player: { type: mongoose.Schema.Types....
0
votes
1
answer
259
views
Mongoose how to update array from child to parent
I have following schema for Audio.
const AudioSchema = new mongoose.Schema({
name: {
type: String,
required: true
},
uploaderId: {
type: String,
required: ...
0
votes
1
answer
178
views
NodeJs Mongoose - remove one id from array in document
I have an array in my model document. I would like to remove one id in that array. Is this possible?
This is what I tried.
module.exports.RemoveFavourite = async (req, res, next) => {
try {
...
0
votes
0
answers
89
views
How to delete an item from an array of mongoDB document?
This is the mongoDb document and it have listItems in it in form of Array. How can I delete the objects inside listItems with their respective itemsId.
I'm passing itemsId as a params from url
So ...
0
votes
1
answer
59
views
How can I use mongoose to delete something in an array using an API?
I'm building a todo app and in the database have an employee document containing 2 arrays (todo & done). The tasks are stored here, and I currently can add tasks to the arrays, but I'm having ...
0
votes
1
answer
50
views
MongoDB: Updating arrays of sub documents after document deletion
I have an API in which I am deleting 'course' documents in the following way:
module.exports.deleteCourse = function(req, res){
var courseid = req.params.courseid;
if(courseid){
Course....