Reputation: 5968
i am learning knexjs and this is my code:
await knex('vendor_message').insert(data).returning(['message_id',
'type',
'content',
'created_on',
'last_update_on',
'vendor_email']);
i was expecting it to return those fields from the db something like this:
[
{
'message_id': 'asdsd',
'type':2,
'content':'adddd',
'created_on':'xxxx',
'last_update_on':'xxxx',
'vendor_email':'[email protected]'
}
]
but it only returns the id: e.g.:
[ 687 ]
i don't want to return the arguments inserted, i want it from the db
Upvotes: 3
Views: 3424