Bot releases are visible (Hide)
import { config } from "meteor/jagi:astronomy";
config.logs.deprecation = false; // Turn off deprecation warnings.
config.logs.nonExistingField = false; // Turn off warnings about non existing fields.
config.logs.classDuplicate = false; // Turn off class duplication warnings.
config.logs.typeDuplicate = false; // Turn off type duplication warnings.
getModified
and getModifiedValues
methods to only include fields that will actually be saved using the save({ fields: [/* list of fields */] })
option.beforeSave(e) {
const doc = e.target;
console.log(doc.getModified({ fields: e.fields }));
console.log(doc.getModifiedValues({ fields: e.fields }));
}
save
method:user.save({ fields: ["firstName"] });
The fields option will be available in the event handler.
events: {
beforeSave(e) {
if (
e.fields &&
e.fields.includes("firstName") &&
e.currentTarget.isModified("firstName")
) {
// Do something...
}
}
}