Ich bin mit Meteor/Winkel an einem Projekt arbeiten, und ich will id erhalten, während ein Element EinsetzenWie kann ich id erhalte beim Einfügen Meteor/angular2
meinen Code verwenden ==>
collection.insert({
name: name,
birthDay: birthDay ,
birthPlace:birthPlace,
nationalities:nationalities,
fields : fields
});
ich versuche, diese aber es funktioniert nicht
const col = collection.insert({
name: name,
birthDay: birthDay ,
birthPlace:birthPlace,
nationalities:nationalities,
fields : fields
});
console.log(col);
Sie sollten die ID in der Spalte Variable erhalten wie du es versucht hast. Können Sie mehr Code bereitstellen? –
Ist Ihre 'collection' Variable eine Meteor-rxjs [' MongoObservable.Collection'] (https://angular-meteor.com/api/meteorx/s/latest/ObservableCollection#new_Collection_new) oder ein Meteor ['Mongo. Sammlung?] (Http://docs.meteor.com/api/collections.html#Mongo-Collection)? – ghybs
Ich benutze MongoObservable.Collection – Dev