These are chat archives for Automattic/mongoose

14th
Apr 2017
Nukool Limrat
@Windowsz
Apr 14 2017 04:20
hi
can i use $gte $ne check String value
viswanathreddy
@viswanathreddy
Apr 14 2017 06:37
@zhipengyue are you sure, database is connected ?
Dan Cancro
@dancancro
Apr 14 2017 19:12
I'm new to Mongoose. Does this schema definition look ok? When I do a patch request, all the documents are updated, not just the one for the given id. If I do a put request I get a 500 internal server error. The application uses Feathers and Mongoose. I want simple ids, not 24 character HexStrings.
import * as mongoose from 'mongoose'

const schema = new mongoose.Schema({
  _id: { type: String, required: true },
  text: { type: String, required: false },
  colour: { type: String, required: false },
  left: { type: String, required: false },
  top: { type: String, required: false },
  createdAt: { type: Date, 'default': Date.now },
  updatedAt: { type: Date, 'default': Date.now }
})

export default mongoose.model('Note', schema, 'note')
Dawid Kraus
@terlord1
Apr 14 2017 20:48
are you using HAML or Typescript?

// User Schema
var UserSchema = new Schema({
username: {
type: String,
index:true,
unique:true
},
password: {
type: String
},
email: {
type: String
},
name: {
first: String,
last: String
}
});

var User = module.exports = mongoose.model('User', UserSchema);

how do i read from the database and I inject it into my handlebars template?
I made a login and reg system and I want it so that your name appears on the top like "Hello Mohammed" also how to insert images
Like little avatars
Anyone?
Dan Cancro
@dancancro
Apr 14 2017 21:00
@terlord1 I'm using TypeScript
Dawid Kraus
@terlord1
Apr 14 2017 21:01
Oh