I wanto to get a length of an object using the mongoose lib
here is my code
const mongo = require("../../server") // model call
{...}
var query = 'email@email.com'; //get an email
var db = mongo.connection;
db.db.collection("user").findOne({email:query}, function(err, result) {
if (err) throw err;
if ( result.length > 0) {...} // here I want to get my object length
In result.length Im getting an error because there's no length in my object , so someone know's how can I get it ?