Skip to content

save command is still written to db, even though subsequent save fails #18

Closed
@rushabhnagda11

Description

@rushabhnagda11

Both are mongoose schemas.

task.save(Product,product.product) .save(ProductFinals,_.assign(product.productFinal, {product_id : { $ojFuture : "0._id"}}))

The data in the first command is fine.
Data for the second save command has a validation error (intentional).

 ` task.run({useMongoose : true})
  .then(() => {
    res.sendStatus(200)
  })
  .catch((err) => {
    console.log(JSON.stringify(err))
  })`

Expeceted behavior : Everything is rolled back
Observed Behavior : Goes to the error block of the run command, but the first save is committed to the db.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions