To insert a document, you need to provide a
Zend_Cloud_DocumentService_Document object or associative array
of data, as well as the collection in which you are inserting it.
Many providers require that you provide a document ID with your document. If using a
Zend_Cloud_DocumentService_Document, you can specify this by
passing the identifier to the constructor when you instantiate the object. If using an
associative array, the key name will be adapter-specific locations; for example, on
Azure, the ID is made up of the PartitionKey and RowKey; on Amazon SimpleDB, the ID is
the ItemName; you may also specify the key in the _id field to be
more portable.
As such, the easiest and most compatible way to specify the key is to use a Document object.
Example 75. Inserting a document
<?php
// Instantiating and creating the document
$document = new Zend_Cloud_DocumentService_Document(array(
'key1' => 'value1',
'key2' => 123,
'key3' => 'thirdvalue',
), "DocumentID");
// inserting into the "mydata" collection
$documents->insertDocument("mydata", $document);




