If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"
npm adduser
| { | |
| "always_show_minimap_viewport": true, | |
| "bold_folder_labels": true, | |
| "color_scheme": "Packages/ayu/ayu-dark.tmTheme", | |
| "font_options": | |
| [ | |
| "gray_antialias" | |
| ], | |
| "font_size": 11, | |
| "ignored_packages": |
| #!/bin/bash | |
| sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
| echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list | |
| sudo apt-get update | |
| sudo apt-get install -y mongodb-org=3.0.0 mongodb-org-server=3.0.0 mongodb-org-shell=3.0.0 mongodb-org-mongos=3.0.0 mongodb-org-tools=3.0.0 | |
| sudo service mongod start |
If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"
npm adduser
| ///////////////////////////// | |
| /// Playing with MongoDB /// | |
| // 3 - Updating documents / | |
| ////////////////////////// | |
| // MongoDB Driver instance. | |
| var MongoClient = require('mongodb').MongoClient | |
| // Set the database and collection name you want to connect to perform the update. |
| // File System node module. | |
| var fs = require('fs'); | |
| // Amazon SDK node module. | |
| var AWS = require('aws-sdk'); | |
| // Read a file in the project folder that contains your AWS credentials. | |
| // On a production server, you would want to reference the credentials using environmental variables. |
| ///////////////////////////// | |
| // Playing with MongoDB //// | |
| // 2 - Finding documents // | |
| ////////////////////////// | |
| // MongoDB Driver instances. | |
| var MongoClient = require('mongodb').MongoClient | |
| , ObjectId = require('mongodb').ObjectID |
| ////////////////////////////// | |
| // Playing with MongoDB ///// | |
| // 1 - Inserting documents / | |
| /////////////////////////// | |
| // MongoDB Driver module. | |
| var MongoClient = require('mongodb').MongoClient | |
| // Set the name of the database you want to connect with. |
With Node you can write very fast JavaScript programs serverside. It's pretty easy to install Node, code your program, and run it. But > how do you make it run nicely in the background like a true server?
/etc/init/$ sudo vim yourapp.conf$ sudo start yourapp$ sudo stop yourapp | Set-ExecutionPolicy RemoteSigned | |
| $mongoDbPath = "C:\MongoDB" | |
| $mongoDbConfigPath = "$mongoDbPath\mongod.cfg" | |
| $url = "https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.4.zip" | |
| $zipFile = "$mongoDbPath\mongo.zip" | |
| $unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-2.6.4" | |
| if ((Test-Path -path $mongoDbPath) -eq $True) | |
| { |
| var MongoClient = require('mongodb').MongoClient; | |
| MongoClient.connect('mongodb://localhost:27017/course', function(err, db) { | |
| if(err) throw err; | |
| for (var i = 0; i<10; i++) { | |
| var fields = ["Engineering", "Medicine", "Marketing"]; | |
| var langs = ["EN", "POR", "ES"]; |