Meteor
Last updated
Last updated
see also
Kadira Academy
_ (don't do data management and auth on route level)
x
_
Little Projects
Tools:
admin for mongo db:
Inspired from this guide: 1. Sign up 2. add 'winston' and 'winston-loggly' to package.json 3. code Don't forget Meteor.npmRequire is only available on server side 4. LOGGER.info
will output on console and send events to loggly
meter add email
DB
When setup db, enable db oplog
If your query has a limit but not a sort specifier, your query can't take advantage of oplog
Posts.find({category: "meteor"}, {limit: 10});
Counting on the server side
Publication
Users.find({}, {fields: {password: 0, hash: 0}})
Subscription
_ Observer
Reduce wait time: this.unblock()
this.unblock
will allow the next available DDP message to process without waiting for the current method.
Use it when your methods and subscriptions (enabled via this package: meteor add meteorhacks:unblock
) don't depend on others
Do not use it when a method will cause side effects and subsequent methods will depend on those side effects.
For example you have a method to update name and another method to send notification emails about the updated name, if unblock is used, the email might contain the old name.
This is all on a per client basis: there no blocking involved globally.
ReactiveVars don't have global names, like the "foo" in Session.get("foo"). Instead, they may be created and used locally, for example attached to a template instance, as in: this.foo.get(). // 'this' is the template instance
ReactiveVars are not automatically migrated across hot code pushes, whereas Session state is.
ReactiveVars can hold any value, while Session variables are limited to JSON or EJSON.
collection-fs
go directly to S3
Set ACL to 'private' so only your meteor app can download the file
Use S3 sdk to generate pre-signed url for public download
Or see my
regiter
with (Mail capability):
Then you can use the mail package to send email:
Reference:
_
_
_
limit (cannot do both inclusion/exclusion) on publication:
, problem demo on
Use to avoid re-sub when route changes
Try
You can store in the . A ReactiveVar is similar to a Session variable, with a few differences:
tips:
slingshot:
Upload and download in server
Upload to any path in server: