balderdashy / balderdashy/sails

.create method storing undeclared attributes as data type value

Open
#6,923 2 comments 0 reactions 0 assignees View on GitHub
help wanted mongo orm try this out please
Dominant language
JavaScript
Stars
22.8k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

**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
```javascript
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:

```javascript
{
name : 'Swift',
description : "",
};
```
But i don't want to store description value in database.i need help asap


Contributor guide

Open the contributing guide

Research direction

The payload provides a model definition rather than a repository file; start by reproducing the .create call with schema: true and an omitted description. Compare the stored record with the declared attributes, then clarify whether the expected behavior concerns the declared description field or truly undeclared attributes. Done means the intended omission behavior is clearly established and covered by the relevant persistence test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.