It seems I cannot get a unique attribute to validate / validate unique values when using Mongo in SailsJS. I get the same usernames. Any suggestions? I checked another post about this, but it was related to using Disk / Memory databases.
Sails 0.10.x with sails-mongo@0.10.x
Model:
module.exports = {
attributes: {
username:{
type:'string',
unique:true,
required:true
}
}
};
Connections.js configuration file
mongo: {
adapter: 'sails-mongo',
host: 'localhost',
port: 27017,
schema:true,
migrate: 'safe',
database: 'mydatabase'
},
source
share