balderdashy/sails

.create method storing undeclared attributes as data type value

Open

#6.923 geöffnet am 31. Dez. 2019

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (22.778 Stars) (1.953 Forks)batch import
help wantedmongoormtry this out please

Beschreibung

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

Contributor Guide