Mongoose Association query

when you associate with mysql, you can use id to associate, and you can store two tables during the same database operation. Because the primary key id can be self-increasing and is not affected by other factors, the two tables can be associated with id, but the id of mongoose is generated by timestamp, which means that two tables are operated separately in the same function, and the order of execution makes it impossible to have the same id. Then how to associate with id? Or add an intermediate field to associate?


to match ref, in schema followed by db.find (). Populate ({path: 'refl', select:'fielid',options: {}})

Menu