-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
The upsert and get commands are not implemented, they might be useful.
The upsert command is similar to save:
public function upsert( $document ) {
$document = (object) $document;
$partitionValue = $this->findPartitionValue( $document );
$document = json_encode( $document );
$headers = $this->triggersAsHeaders( "create" );
$headers['x-ms-documentdb-is-upsert'] = 'True';
$result = $this->collection->createDocument( $document, $partitionValue, $headers );
$resultObj = json_decode( $result );
if ( isset( $resultObj->code ) && isset( $resultObj->message ) ) {
throw new Exception( "$resultObj->code : $resultObj->message" );
}
return $resultObj->_rid ?? null;
}
While the get should simply take advantage of the CosmoDB getDocument method already implemented.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels