this ID is clearly documented. Why report this error?
this ID is clearly documented. Why report this error?
if I understand it correctly, those who call mongodb should use _ id to call it.
is not clear if you just read the wrong message. I suggest you post the code for everyone's reference
one is ObjectId and the other is a string. How can it match?
{_id: ObjectId("5c2f336c56ea5a44884ac7a8")} //
{_id:"5c2f336c56ea5a44884ac7a8"} //
it is also recommended to use text instead of screenshots when asking questions. For example, 5c2f336c56ea5a44884ac7a8
I typed it out in front of the screenshot, and it doesn't make sense for everyone to waste time on it. And upstairs is also very correct, if the relevant code is not given, we are based on past experience to guess, it is very disadvantageous to solve the problem.
use _ id. {_ id: ObjectId ("5c2f336c56ea5a44884ac7a8")} is just a way to store it in the database. Actually using _ id is feasible
.query router.get(" cartList", (req, res, next) => { User.findOne({ userId: 123456 }, (err, doc) => { }); } query router.get(" cartList", (req, res, next) => { let userId = req.cookies.userId console.log(user...
I have read the document for a long time, and I have a general understanding of the concept grammar and so on, but when I really write it, I still have a lot of problems and always get stuck. such as the following this.ctx.model.Role.remove({ _id: { ...
const UserSchema = new Schema({ userId:Schema.Types.ObjectId, username: String, mobile: String, password: String, remarks: String, createAt: {type: Date, default: Date.now}, updateAt: {type: Date, default: Date.now}, ...
the model is designed as follows const RegistrationSheet = mongoose.model( RegistrationSheet , new Schema({ doctorId: String, today: { time: String, date: { morning: [ { number:Number, patient: ...
The structure is shown in the figure. Steps is an array. Now you want to modify the count value of a specified date. ...
problem description there is a shopping cart cartList field under the user table. The field type is as follows: cartList: [ { shopId: { type: Schema.ObjectId }, shopName: String, goodsList: [ ...
topic description the following is a set of built replicas, where 12 nodes are arbitration nodes 192.168.1.10 br 27017 192.168.1.11 purl 27017 192.168.1.12 purl 27017 replica set set is: sss nodejs uses mongoose middleware to connect to mongodb...
the specific code is as follows: node beginners, excuse me const mongoose = require( mongoose ); mongoose.connect( mongodb: ) mongoose.model( content ,{}).find({}) .then( feeds =>{ console.log(feeds); }) the printed result ...
question: is it not recommended to use multi-table queries for mongodb non-relational databases? ...
problem description after the post request is sent by the current end, the database successfully writes the data, but the backend still reports an error of Error: connect ECONNREFUSED 127.0.0.1, and returns 500. the environmental background of the p...