-
Notifications
You must be signed in to change notification settings - Fork 0
Meteor
Colm O'Gairbhith edited this page Sep 26, 2016
·
26 revisions
- meteor create first_app
- cd first_app
- meteor
- meteor add twbs:bootstrap
- meteor add accounts-ui accounts-password
- meteor add iron:router
- meteor -p $IP:$PORT (to start up the app in cloud9)
- meteor deploy upscribers.meteor.com
- meteor deploy --delete upscribers.meteor.com
- meteor remove insecure
- From c9.io CLI
- meteor add accounts-google
- export ROOT_URL='https://ecles-weekends-carbontracking.c9users.io'
- This is what is entered on the command line in c9.io to correspond with the Authorised JavaScript origins in https://ecles-weekends-carbontracking.c9users.io/
- On Google OAUTH client configuration
- Authorised JavaScript origins = https://ecles-weekends-carbontracking.c9users.io
- Authorised redirect URIs = https://ecles-weekends-carbontracking.c9users.io/_oauth/google
- From a command shell, once the app is running do
- meteor mongo
- this puts you in the mongo shell of the local webapp
- now all the mongo shell comands can be run
- show collections (this will list all collections)
- db.users.find()
- List of operators e.g. $eq, $gt,
- NOTE that if you need to search in an array then you need to use the $elemMatch operator, e.g. db.users.find({emails : { $elemMatch : { "address":"colm@1.com" }}})
- This is from an example where you have { "emails" : [ { "address" : "colm@1.com", "verified" : false } ] }
- db.lieux.insert({'name' : 'La Foret de Bouconne'});
- db.lieux.update({ "_id" : ObjectId("57e8e9b842be9e0fb0915d7d")},{'name' : 'La Foray','GoogleRef' : 'x, y et z'});
- This will update the entry referred to by _id. Note that you need to specify all fields in the second part, otherwise it will remove all non-referenced fields
- db.users.findAndModify({ query:{emails : { $elemMatch : { "address":"colm@111.com" }}}, update:{$set:{ "roles":"IsGod"}} });