Created
January 31, 2011 00:55
-
-
Save lukegalea/803495 to your computer and use it in GitHub Desktop.
Mongoose Find Issue
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 path = path = require('path'); | |
require.paths.unshift(path.join(__dirname, "../node_modules")); | |
require.paths.unshift(path.join(__dirname, "../vendor")); | |
require('noop'); | |
var mongoose = require('mongoose'), | |
Schema = mongoose.Schema; | |
mongoose.connect('mongodb://localhost/pumper'); | |
var ObservationSchema = new Schema({ | |
date_time: Date//{ type: Date, index: true }, | |
}); | |
var UserSchema = new Schema({ | |
date_time: Date//{ type: Date, index: true }, | |
}); | |
mongoose.model('Observation', ObservationSchema); | |
mongoose.model('User', UserSchema); | |
var Observation = mongoose.model('Observation'), | |
User = mongoose.model('User'); | |
var o = new Observation({ date_time: new Date() }); | |
o.save(global.throwop); | |
mongoose.model('Observation').find({}, null, {}, function(err, observations) { | |
console.dir(observations); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yep. Same deal.