I am trying to insert an object in Family Data collection and in callback function .I want to insert the id which is created in FamilyData collection along with Object into UserData collection,But ,I FamilyData is inserting properly object in callback function is showing null.But this error is coming from past 3 days.Previously I was able to insert both collections without any error.
I attached my code which is at server.js below:
console.log("user id present");
console.log("fiber",JSON.stringify(obj))
FamilyData.insert({
FamilyName: obj.FamilyName,
Address: obj.Address,
CreatedBy: obj.firstname,
Latitude: obj.latitude,
Longitude: obj.longitude
}, function (err, Id) {
UserData.insert({
FirstName: obj.firstname,
LastName: obj.lastname,
Gender: obj.genderval,
DateOfBirth: obj.dob,
Email: obj.email,
Password: obj.pwd,
FamilyId: Id,
UserId: userId,
});
});
Error is: