When I use Collection2 in angular2-meteor project, these kinds of codes from demo always give me warning in the terminal:
No best common type exists among return expressions.
How can I improve the codes? Thanks
{
createdAt: {
type: Date,
autoValue: function() {
if (this.isInsert) {
return new Date();
} else if (this.isUpsert) {
return {$setOnInsert: new Date()};
} else {
this.unset();
}
}
}
}
return undefined;
afterthis.unset();
, but it still gives me the warning. – CarawayautoValue
function doesn't have appropriate return type and alsothis.unsert
is not clear. set some return type to that function. – Govern