balderdashy/sails

.create method storing undeclared attributes as data type value

Aperta

#6923 aperta il 31 dic 2019

 (2 commenti) (0 reazioni) (0 assegnatari)JavaScript (1953 fork)batch import
help wantedmongoormtry this out please

Metriche repository

Star
 (22.778 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Node version: v13.0.1 Sails version (sails): 1.2.3 ORM hook version (sails-hook-orm): ^2.1.1 Sockets hook version (sails-hook-sockets): ^2.0.0 Grunt hook version (sails-hook-grunt): ^4.0.0 Sails mongo version (sails-mongo): ^1.0.1

This is master model

module.exports = {
  tableName: 'MASTER',
  schema: true,
  attributes: {
    name: {
      type: 'string',
      required: true
    },
    description: {
      type: 'string'
    },
  },
};

whenever i am not passing description column value in request then it is storing as empty string value like this:

{
  name : 'Swift',
  description : "",
};

But i don't want to store description value in database.i need help asap

Guida contributor