Bot releases are hidden (Show)
meteorMethods
for defining Meteor methods that will be executed on the client and server like regular Meteor methods.const User = Class.create({
name: User,
collection: Users,
fields: {
firstName: String,
lastName: String
},
meteorMethods: {
rename(first, last, invocation) {
// invocation.isSimulation;
// invocation.unblock();
this.firstName = first;
this.lastName = last;
this.save();
}
}
});
const u = User.findOne();
// Possible ways of invocations.
u.rename('John', 'Smith', (err, result) => {
});
u.callMethod('rename', 'John', 'Smith', (err, result) => {
});
u.applyMethod('rename', ['John', 'Smith'], (err, result) => {
});
You can read more about Meteor methods in docs
methods
have been renamed to helpers
. You can still use the methods
property but it's deprecated and will be removed in the future Astronomy releases.getChildren
class method to get children on all depthsParent.find(selector, {
children: true // Get children, grand children and so on
});
Parent.find(selector, {
children: 1 // Get only direct children
});
Parent.find(selector, {
children: 2 // Get children and grand children
});
Parent.getChildren(/* default true */);
audit-argument-checks
packageNew features:
Post
class you can now validate by calling Post.validate(rawData)
or Post.validateAll(rawData)
Post
class you can call const pattern = Post.getCheckPattern()
to get pattern and use it in the check check(doc, pattern)
Fixes:
find()
methodvalidated-method
package)set()
method. Right now, if you don't want to clone by default, you can do so with the following code new Post(args, {clone: false})
and post.set(args, {clone: false})
.BREAKING CHANGES!
children
option set to true
by default in the Class.find()
methodNEW FEATURES!
Class.update()
and Class.remove()
methodscollection
and typeField
properties in child classesinteger
validator... and bug fixes