Added node-modules

This commit is contained in:
Dobie Wollert
2014-09-14 07:04:16 -04:00
parent 663941bf57
commit 6a92348cf5
4870 changed files with 670395 additions and 0 deletions

40
node_modules/mongoose-pureautoinc/examples/example.js generated vendored Normal file
View File

@ -0,0 +1,40 @@
/**
* @author Dmitry Ilin @ MyLove Company, LLC <dmitry@mylovecompany.com>
*/
var dbName = 'pureautoinc_example',
mongoose = require('../node_modules/mongoose'),
Schema = mongoose.Schema,
db = mongoose.createConnection('127.0.0.1', dbName),
pureautoinc = require('../index');
pureautoinc.init(db);
var schema = new Schema({
name: String,
address: String
});
schema.plugin(pureautoinc.plugin, {
model: 'Person',
field: 'filingNumber',
start: 100
});
var Person = db.model('Person', schema);
console.log('Database: ' + dbName);
console.log('Collection: ' + Person.collection.name);
var person = new Person({
name: 'Sherlock Holmes',
address: '221b Baker St, Marylebone, London W1'
});
person.save(function (err, res) {
console.log('New record added:');
console.log(res);
mongoose.disconnect();
});