python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Keep only 5 elements in array removing the last one when pushing mongodb to always have only 5 elements
I need to maintain an array of objects in MondoDB with only 5 elements, if another element is to be added, the first one is deleted and the new one is added, but always only 5 elements. Is there any w...
OscarDev
Votes: 0
Answers: 1
CastError: Cast to ObjectId failed for value "XXXXXXXXXX" (type string) at path "_id" for model "User" for passport-linkedin-oauth2
Getting the above error when trying to authenticate a new user using LinkedIn's oAuth 2.0. It looks like I'm getting passed a 10 digit ObjectId instead of a 12 or 24 character id...
passport.use(new L...
Fiattarone
Votes: 0
Answers: 1
How to assign multiple unknown properties to a mongoose document
I'm trying to write an update function for my documents from mongoDB, So I'm fetching the document based en filters, want to pass properties from a data object to the document but it looks like Object...
Diamonddedo
Votes: 0
Answers: 0
Node, Mongoose search inside nested object
I have the following Schema:
@Schema()
export class Category extends Document {
@Prop({ required: 'Category name is required' })
name: string;
@Prop({ default: true })
active: boolean;
}
exp...
Arleen Silva
Votes: 0
Answers: 0