Closed IonicaBizau closed 11 years ago
Do you do something like this self.emit('update', {/*crud*/}, function () {})
? Or can you give me a link to the code which makes the request?
I use insert
parameter.
self.emit("insert", crudObj, function (err, insertedDoc) { ... });
//////////////////////
// NEW LIST/NEW FOLDER
//////////////////////
DmsTree.newList = function (listObj, callback) {
if (!currentTemplate) { return alert("Select a template, first."); }
listObj._ln = [
{
_tp: "_template",
_id: currentTemplate._id
}
];
var crudObj = {
t: "_list",
d: listObj
};
DmsTree.emit("insert", crudObj, function (err, insertedDoc) {
if (err) {
alert(err);
return;
}
if (callback) { callback(err, insertedDoc); }
DmsTree.emit("newListInserted", listObj);
});
};
(from dms-tree, main.js)
This is obsolete now.
I want to insert a new list using bind-crud.
My crud object looks like this:
Bind-crud throws
Error: Missing required field: _id
. Why? I guess that the_id
of this object will be generated, being a MongoId.Is this a bug or my mistake?