This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async'); | |
global._clients = {}; | |
var mongoose = require('mongoose'); | |
global._mongoose = mongoose; | |
var conf = { | |
db: { | |
db: 'gendocx', | |
host: 'localhost', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// working example mongoose | |
var tableASchema = new Schema({ | |
template : String, | |
description : String | |
}); | |
var tableBSchema = new Schema({ | |
group : String, | |
a_pk : [{ type: Schema.ObjectId, ref: 'tableA' }], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// working example mongoose | |
var PersonSchema = new Schema({ | |
name : String, | |
age : Number, | |
}); | |
var StorySchema = new Schema({ | |
title : String, | |
}); | |
var Story = mongoose.model('Story', StorySchema); | |
var Person = mongoose.model('Person', PersonSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Afghanistan", | |
"code": "AF" | |
}, | |
{ | |
"name": "Åland Islands", | |
"code": "AX" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Andaman and Nicobar Islands", | |
"code": "AN" | |
}, | |
{ | |
"name": "Andhra Pradesh", | |
"code": "AP" | |
}, | |
{ |
NewerOlder