Cast string in objectId type field in mongodb
I have a problem in implementing a logic, please provide some ways to solve this problem.
i have a schema named sales and a schema named development. In Sales schema there is a field for development:
development: { type: mongoose.Schema.ObjectId, ref: "Development" },