Using `session.ensure` on a Metadata entity will throw a Duplicate Entry error
1 1

2 posts in this topic

It's my understanding that using the following code should always return the same metadata entity:

const metadata = await session.ensure(
  'Metadata', {parent_id: "7bd2c20a-f7a1-11ea-8466-005056829324", key: "builds", parent_type: "Breakdown"}
);

If the entity did not exist before, `session.ensure` would create it, and if it did exist it would simply return the existing entity. Instead, if the entity already exists this will throw a Duplicate Entry error.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1 1