Mongo on Raspberry Pi 3 B+

pi@pineapple:~ $ sudo apt-get install mongodb
...
Setting up mongodb-clients (1:2.4.14-4) ...
Setting up libmongoclient-dev:armhf (1.1.2-5) ...
Setting up mongodb-dev (2:1.1.2-5) ...
Setting up mongodb-server (1:2.4.14-4) ...
Adding system user `mongodb' (UID 111) ...
Adding new user `mongodb' (UID 111) with group `nogroup' ...
Not creating home directory `/var/lib/mongodb'.
Adding group `mongodb' (GID 115) ...
Done.
Adding user `mongodb' to group `mongodb' ...
Adding user mongodb to group mongodb
Done.
Created symlink /etc/systemd/system/multi-user.target.wants/mongodb.service → /lib/systemd/system/mongodb.service.
Setting up mongodb (1:2.4.14-4) ...
...
pi@pineapple:~ $ mongo
MongoDB shell version: 2.4.14
connecting to: test
Server has startup warnings:
Fri Nov 23 16:14:54.933 [initandlisten]
Fri Nov 23 16:14:54.933 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Fri Nov 23 16:14:54.934 [initandlisten] **       32 bit builds are limited to less than 2GB of data (or less with --journal).
Fri Nov 23 16:14:54.934 [initandlisten] **       See http://dochub.mongodb.org/core/32bit
Fri Nov 23 16:14:54.934 [initandlisten]
> db
test
> show dbs
local   0.03125GB
> use myNewDatabase
switched to db myNewDatabase
> db.myCollection.insert( { x: 1} );
> db.myCollection.find();
{ "_id" : ObjectId("5bf88e0a8d7e6c7adddc46de"), "x" : 1 }
> show dbs
local   0.03125GB
myNewDatabase   0.0625GB
> db.myCollection.insert( { name: "justin", age: 41, status: "cool", groups: [ "swimming", "computer science" ] } );
> k = { name: "heather", age: 39, status: "cool", groups: [ "zumba" ] }
{
    "name" : "heather",
    "age" : 39,
    "status" : "cool",
    "groups" : [
        "zumba"
    ]
}
> db.myCollection.insert(k);
> db.myCollection.find();
{ "_id" : ObjectId("5bf88e0a8d7e6c7adddc46de"), "x" : 1 }
{ "_id" : ObjectId("5bf890188d7e6c7adddc46df"), "name" : "justin", "age" : 41, "status" : "cool", "groups" : [  "swimming",  "computer science" ] }
{ "_id" : ObjectId("5bf890578d7e6c7adddc46e0"), "name" : "heather", "age" : 39, "status" : "cool", "groups" : [  "zumba" ] }
> db.myCollection.remove( { "x" : 1 } );
> db.myCollection.find();
{ "_id" : ObjectId("5bf890188d7e6c7adddc46df"), "name" : "justin", "age" : 41, "status" : "cool", "groups" : [  "swimming",  "computer science" ] }
{ "_id" : ObjectId("5bf890578d7e6c7adddc46e0"), "name" : "heather", "age" : 39, "status" : "cool", "groups" : [  "zumba" ] }
> db.myCollection.update( { "name": "justin" }, { $set: { "age": 45 } } );
> db.myCollection.find( { "name": "justin" } );
{ "_id" : ObjectId("5bf890188d7e6c7adddc46df"), "name" : "justin", "age" : 45, "status" : "cool", "groups" : [  "swimming",  "computer science" ] }
> db.myCollection.update( { "name": "heather" }, { $set: { "age": 43 } } );
> db.myCollection.find( { "name": "heather" } );
{ "_id" : ObjectId("5bf890578d7e6c7adddc46e0"), "name" : "heather", "age" : 43, "status" : "cool", "groups" : [  "zumba" ] }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s