Tags » Mongodb

nodejs: mongoose module and mongodb

The post shows how a nodejs program connects to mongoDB with mongoose module.

version

bash-3.2$ node -v
v8.1.4

init nodejs project

bash-3.2$ npm init
This utility will walk you through creating a package.json file. 703 more words
Nodejs

mongodb: find(), limit() and skip()

The post shows how to use limit() and skip() to partial shows data.

version

bash-3.2$ mongo
MongoDB shell version v3.4.6
connecting to: mongodb://127.0.0.1:27017

show all documents… 180 more words

Mongodb

mongodb: find and projection

This post discusses find and projection in mongoDB.

version

bash-3.2$ mongo
MongoDB shell version v3.4.6
connecting to: mongodb://127.0.0.1:27017

insert document into a collection
Add four documents into test.member collection. 197 more words

Mongodb

mongodb: mongo shell and insert data

The post discusses using mongoDB shell to insert data.

software version

bash-3.2$ mongo
MongoDB shell version v3.4.6

connect to mongodb database

bash-3.2$ mongo
MongoDB shell version v3.4.6
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.6
Server has startup warnings: 
2017-07-26T20:43:13.356+0800 I CONTROL   
2017-07-26T20:43:13.357+0800 I CONTROL   ** WARNING: Access control is not enabled for the database. 233 more words
Mongodb

mongodb: mongod and mongo shell

The post discusses mongod and mongo shell.

software version

bash-3.2$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.6
BuildVersion:   15G1510
bash-3.2$ mongod --version
db version v3.4.6
git version: c55eb86ef46ee7aede3b1e2a5d184a7df4bfb5b5
OpenSSL version: OpenSSL 1.0.2l  25 May 2017
allocator: system
modules: none
build environment:
    distarch: x86_64
    target_arch: x86_64
bash-3.2$ mongo --version
MongoDB shell version v3.4.6
git version: c55eb86ef46ee7aede3b1e2a5d184a7df4bfb5b5
OpenSSL version: OpenSSL 1.0.2l  25 May 2017
allocator: system
modules: none
build environment:
    distarch: x86_64
    target_arch: x86_64
… 502 more words
Mongodb

mongodb: install mongodb in Mac OS X

The post discusses installing mongoDB in Mac OS X.

software version

bash-3.2$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.6
BuildVersion:   15G1510

what is mongodb
A non-sql database. 639 more words

Mongodb

Finding slow queries at MongoDB

Enable profiling

First, you have to enable profiling.

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it’s full, old queries go out, so don’t be surprised that it’s a moving target. 37 more words