You are not logged in.
Pages: 1
Hello gurus,
Is it possible to add and object with blobs with one POST request?
With other words:
with 2 POSTs:
Result := ConnectionManager.DocumentClient.Add(msg.Details, true) >= 0;
ConnectionManager.DocumentClient.UpdateBlobFields(msg.Details);
I tryed to make it with batch:
ConnectionManager.DocumentClient.BatchStart(msg.Details.RecordClass);
ConnectionManager.DocumentClient.BatchAdd(msg.Details, True, False);
ConnectionManager.DocumentClient.BatchUpdate(msg.Details, 'Document');
res := ConnectionManager.DocumentClient.BatchSend(ids);
Result := res = HTML_SUCCESS;
but I have an exception on the server:
20151210 10125718 EXC EORMBatchException {"Message":"TSQLRestServerDB.EngineBatchSend: Missing ["} at 005A0712 stack trace 00596B66 0598425 005BE8DF 005233A7 004E59CB 00522E9F 00522ECC 00522F56 004BBD84 0040AD2A 764C3677 77529F42 77529F15
I use:
1. Delphi XE7
2. CrossPlatform client
3. server is based on mongoDB
and common question:
what is the optiomal way to ADD full objects with blobs?
Pls show me the way.
Thanks a lot.
Offline
On Batch-Level use following overloaded method: TSQLRestBatch.Add(Value: TSQLRecord; SendData,ForceID: boolean; const CustomFields: TSQLFieldBits; DoNotAutoComputeFields: boolean): integer;
This would send all fields, including Blobs:
ConnectionManager.DocumentClient.BatchAdd(msg.Details, True, False, ALL_FIELDS);
Offline
Thanks for your answer.
I use crossplatform library.
The syntax is little bit other:
ConnectionManager.DocumentClient.BatchAdd(msg.Details, True, False, '*');
and when I use it I have the same error
20151210 10125718 EXC EORMBatchException {"Message":"TSQLRestServerDB.EngineBatchSend: Missing ["} at 005A0712 stack trace 00596B66 0598425 005BE8DF 005233A7 004E59CB 00522E9F 00522ECC 00522F56 004BBD84 0040AD2A 764C3677 77529F42 77529F15
Offline
Just updated.
You have saved my night
Thanks a lot. Works fine.
Offline
Pages: 1