I am using Mongoose with MongoHQ and when saving get an error 'collection name must be a String however I am not setting the collection name so Mongoose is using the name of the model by default. Any guidance would eb appreciated.Thanks
--
--
http://mongoosejs.com - docs
http://plugins.mongoosejs.com - plugins search
http://github.com/learnboost/mongoose - source code
You received this message because you are subscribed to the Google
Groups "Mongoose Node.JS ORM" group.
To post to this group, send email to mongoo...@googlegroups.com
To unsubscribe from this group, send email to
mongoose-orm...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/mongoose-orm?hl=en
---
You received this message because you are subscribed to the Google Groups "Mongoose Node.JS ODM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-orm...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
var mongoose = require('mongoose');
var schema = new mongoose.Schema({ date: { type: Date, default: Date.now }, user: 'string', action: 'string' });
var AuditLog = mongoose.model('AuditLog', schema);module.exports.AuditLog = AuditLog;var mongoose = require("mongoose);
mongoose.connect('mongodb://user:pass...@linus.mongohq.com:10055/db_name');mongoose.model('AuditLog', require('./models/auditlog')).AuditLog;
AuditLog.save({ user: 'User Name', action: 'Did something in the application' });var mongoose = require('mongoose');var Schema = mongoose.Schema;module.exports = function() { var schema = new Schema({ date: { type: Date, default: Date.now }, user: 'string', action: 'string' }, { collection: 'log'}); mongoose.model('AuditLog', schema);};
var AuditLog = mongoose.model('AuditLog');var logger = new AuditLog({ user: 'User name', action: 'This is an action'});logger.save(function (err) {});