MrTV
asked on
Maximum value plus one mongodb express
how can I find the maxinum of number not count from how many row and plus one in express mongodb
app.post('/api/department',(request,response)=>{
database.collection("Department").count({},function(error,numOfDocs){
if(error){
console.log(error);
}
database.collection("Department").insertOne({
DepartmentId : numOfDocs+1,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.