1.0.6 • Published 10 years ago

sails-goose v1.0.6

Weekly downloads
4
License
ISC
Repository
github
Last release
10 years ago

https://github.com/carlosmtx/sails-goose

  1. npm install sails-goose

  2. Create a file named "goose.js" in the config folder with this content :

    module.exports.goose = {
    
    myDb : {
    	globals : true ,
    
    	host 	: "localhost",
    
    	port 	: 27017,
    
    	db 		: "test",
    
    	options 	: {
    
    		// db 		: "",
    
    		// server 	: "",
    
    		// replset 	: "",
    
    		// user 	: "",
    
    		// pass 	: "",
    
    		// auth 	: "",
    
    	}
    }

    }

  3. Create the folder "goose-schemas" in the api folder

  1. Add all your schemas in the goose-schema folder using the following structure :

    //File User.js

    module.exports = {

    name : String,
    
    email : String,
    
    birthday : Date,
    
    about : String,
    
    interest : require("Interest.js"),

    };

  2. Add " require('sails-goose')("myDb"); " to "app.js"

  3. If you have set globals to true you can use mongoose models like this:

    	User.find({name : 'teste' });

    Alternatively you can use :

    goose.User 
  4. For a list of all the schema 'options' check : http://mongoosejs.com/docs/connections.html#options

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago