Deep save issue

Hello,
I’m triying to implement deep-save for my requests. In the documentation, it’s always mentionned to use the PUT to make the request (new or update).
But it didn’t work with PUT. It tell me, for a new save to didn’t have the objectId field. So, I have removed it, but it didn’t work. So I try with the POST and it put me this error message:

I’m lost, I don’t know how to use it in my code. What is the way to do for new creation and update? Any changes about the documentation?

Thanks you

Hi @Indevers ,

Documentation states correctly that you need to use PUT for deep save.
Could you please provide a sample of your request body which caused error for PUT request?

Regards, Andriy

Hello,
I tried three thing. with each time this error message

{
  "code": 1321,
  "message": "Deep save exception. The 'UPDATE' operation payload must contain the 'objectId' property with a valid column name.",
  "errorData": {}
}

The first request payload (an empty objectId)

The second request payload (a null objectId)

The third request payload (without the objectId)

@Indevers ,

Server returns an error since you pass objectId with empty string for linkedMainClient nested object.
For “deep save” to work properly you should specify objectId field only for objects which were created in database before. null or empty string are not valid values and will cause exception.

In “deep save” server relies on presence of objectId field to decide which operation, create or update, it should apply for an object.

Try to remove redundant objectId fields from all your nested objects and execute “deep save” operation one more time.

Regards, Andriy

Hello @Indevers,

in your payload you have a link to the user:

 "linkedMainClient": {
        "userId": 12,
        "address": "",
        "location": {
            "coordinates": [
                0.0,
                0.0
            ],
            "type": "Point"
        },
        "email": "",
        "firstname": "",
        "lastname": "",
        "phoneNumber": "",
        "phoneCode": "",
        "profileImage": "",
        "user-token": "",
        "stripeCustomerId": ""
    },

And since the user does not have an objectId, server will consider you’re trying to create a new user, but new user should have a password.

This will be most likely operation count in your transaction. If I am not mistaking then any plan comes with 5 operations, and it can be expanded with function pack for additional operations.

Hello, ok thanks you for the information. How could I know how many operations I have in this cURL for example? It’s permit me to know how I manage this. It’s depend on each object I have to write in my table? The number is count by api call ? in a minute in an api call? How is it calculated?
Thanks you

Deep Save relies on Transaction, and transaction consists of operations. Here you can read about what operation is considered:
https://backendless.com/docs/rest/data_transactions_about_unitofwork.html#operations