Tutorial by Examples: st

This command will create a /dump directory, and store each collection in a separate BSON blob file. This is the best way to backup or transfer databases between systems. mongodump --db meteor
The analog to the meteordump command is meteorrestore. You can do a partial import by selecting the specific collection to import. Particularly useful after running a drop command. # make sure your app is running meteor # then import your data mongorestore --port 3001 --db meteor /path/to/dump...
Mongo supports database-to-database copying, which is useful if you have large databases on a staging database that you want to copy into a local development instance. // run mongod so we can create a staging database // note that this is a separate instance from the meteor mongo and minimongo ins...
Did you know about the --url flag? Very handy. meteor mongo --url YOURSITE.meteor.com
They're not easily accessible. If you run the 'meteor bundle' command, you can generate a tar.gz file, and then run your app manually. Doing that, you should be able to access the mongo logs... probably in the .meteor/db directory. If you really need to access mongodb log files, set up a regular mo...
With the power of regex comes great responsibility.... db.posts.find({'text': /.*foo.*|.*bar.*/i})
db.posts.find().forEach(function(doc){ if(!doc.foo){ db.posts.update({_id: doc._id}, {$set:{'foo':''}}, false, true); } });
db.posts.find().forEach(function(doc){ db.accounts.update({_id: doc._id}, {$set: {'_id': doc._id.str }}, false, true); });
var newvalue = ""; db.posts.find().forEach(function(doc){ if(doc.foo){ newvalue = '"' + doc.foo + '"'; db.accounts.update({_id: doc._id}, {$set: {'doc.foo': newvalue}}); } });
var newvalue = null; db.posts.find().forEach(function(doc){ if(doc.foo){ newvalue = '"' + doc.foo + '"'; db.accounts.update({_id: doc._id}, {$set: {'doc.foo': newvalue}}); } });
db.posts.find().forEach(function(doc){ if(doc._id){ db.posts.update({_id: doc._id}, {$set:{ timestamp: new Date(parseInt(doc._id.str.slice(0,8), 16) *1000) }}, false, true); } });
What we're doing here is referencing the array index using dot notation db.posts.find({"tags.0": {$exists: true }})
Using Dynamic Arrays in VBA can be quite clunky and time intensive over very large data sets. When storing simple data types in a dynamic array (Strings, Numbers, Booleans etc.), one can avoid the ReDim Preserve statements required of dynamic arrays in VBA by using the Split() function with some cl...
Now that the OCaml distribution is available on your favorite operating system, we can create your first program in OCaml: the Hello World! We have different ways to launch an OCaml program. The REPL (toplevel) You can execute your code interactively with the toplevel. With the OCaml toplevel, yo...
In SQL Server 2016 finally they have introduced Split string function : STRING_SPLIT Parameters: It accepts two parameters String: Is an expression of any character type (i.e. nvarchar, varchar, nchar or char). separator : Is a single character expression of any character type (e.g. nv...
Use $state.transitionTo to go form one state to another. This is a low level method to transition and $state.go is the recommended way for most common use cases as it uses this method internally. $state.transitionTo(toState [, toParams] [, options]) toState - the state to transition to toPara...
// initialize pubnub object var pubnub = new PubNub({ subscribeKey: "yourSubscribeKey", publishKey: "myPublishKey" // optional }) // get up to the last 100 messages // published to the channel pubnub.history( { channel: 'channel1' }, func...
Escaping strings is an older (and less secure) method of securing data for insertion into a query. It works by using MySQL's function mysql_real_escape_string() to process and sanitize the data (in other words, PHP is not doing the escaping). The MySQLi API provides direct access to this function $...
To run your unit tests in the simulator using xcodebuild use If you have a workspace (e.g. when using CocoaPods) xcodebuild \ -workspace MyApp.xcworkspace \ -scheme "MyScheme" \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 6,OS=9.1' \ test If ...
There are three ways to set the classpath. It can be set using the CLASSPATH environment variable : set CLASSPATH=... # Windows and csh export CLASSPATH=... # Unix ksh/bash It can be set on the command line as follows java -classpath ... javac -classpath ... Note ...

Page 136 of 369