rethinkdb Getting started with Node Insert a document into a table


r.connect({host: 'localhost', port: 28015})
.then((conn) => {
    return r.db("stackoverflow").table("examples")
            // If `id` is not set, will automatically generate a UUID
            id: 1,

            name: 'Thinker',

            // Will translate Date types.
            creationDate: new Date(),

            // Embedded array
            tags: ['rethinkdb', 'rethinkdb-javascript', 'rethinkdb-python'],

            // Will evaluate `` using server time

            // Embedded document
            location: {
                // Using geospatial example
                coordinates: r.point(-122.423246,37.779388),
                name: 'San Francisco'  
}).then((result) => {
    // Returns results object which includes array of generated UUIDs 
    //  for inserted documents