Tutorial by Examples

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); } });
var timestamp = Math.floor(new Date(1974, 6, 25).getTime() / 1000); var hex = ('00000000' + timestamp.toString(16)).substr(-8); // zero padding var objectId = new ObjectId(hex + new ObjectId().str.substring(8));
What we're doing here is referencing the array index using dot notation db.posts.find({"tags.0": {$exists: true }})
This project is a self-contained example done completely in the Interface Builder. You should be able to work through it in 10 minutes or less. Then you can apply the concepts you learned to your own project. Here I just use UIViews but they can represent whatever view you like (ie, button, label...
These functions are used to check Mouse Button Clicks. Input.GetMouseButton(int button); Input.GetMouseButtonDown(int button); Input.GetMouseButtonUp(int button); They all take the-same parameter. 0 = Left Mouse Click. 1 = Right Mouse Click. 2 = Middle Mouse Click. GetMouseButton i...
Purpose Use the CREATE SEQUENCE statement to create a sequence, which is a database object from which multiple users may generate unique integers. You can use sequences to automatically generate primary key values. When a sequence number is generated, the sequence is incremented, independent of th...
Backbone.js is made up of four separate components: Collections, Models, Routers, and Views. Each of these serve different purposes: Model - represents a single data object, but adds additional functionalities not provided by native JavaScript objects, such as an event system and a more conveni...
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...
If you are just starting a new project, it's important to think about how you want to handle code signing. If you are new to code signing, check out the WWDC session that describes the fundamentals of code signing in Xcode. To properly code-sign your app, you have to have the following resources o...
5 Input type search is used for textual search. It will add magnifier symbol next to space for text on most browsers <input type="search" name="googlesearch">
JSP hooks are a special liferay plugin that allow to modify core portlet jsp-s, lets say you want to modify the login portlet to show Welcome in my custom login!. The minimal structure for a Hook Plugin is as follows: [project-name]-hook/ └── docroot/ ├── WEB-INF/ │ ├── src/ ...
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...
XML fragments, also known under the name of external parsed entities, can be stored in separate files. XML fragments, unlike XML documents, are less restrictive, in that several elements can appear top-level, as well as text nodes. Like an XML document, an external parsed entity may begin with an X...
// 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...
Webhook Overview A WebHook is an HTTP callback: an HTTP POST that occurs when something happens; a simple event-notification via HTTP POST. A web application implementing WebHooks will POST a message to a URL when certain things happen. PubNub Presence Pubnub presence all about the user prese...
Recursion can be categorized as either Head Recursion or Tail Recursion, depending on where the recursive method call is placed. In head recursion, the recursive call, when it happens, comes before other processing in the function (think of it happening at the top, or head, of the function). In ta...

Page 495 of 1336