Releases: jcormont/documentdb-typescript
Releases · jcormont/documentdb-typescript
v1.0.7
v1.0.6
v1.0.5
v1.0.4
v1.0.3
v1.0.2
Minor update to behavior of findDocumentAsync:
- If an object is passed in with an
idproperty, the other properties are now also still checked on the object read from the database. If one of the properties is different, the promise is still rejected.
Example: given a document { id: "foo", bar: 1, ... } in the database
- The previous behavior of
findDocumentAsync({ id: "foo", bar: 2 })was to return the document (wrong!); - The new behavior is that the document is loaded (through the
readDocumentAPI, using the ID), but an error is thrown upon checking thebarproperty.
Bug fixes
v1.0.0
- Important: This version now requires TypeScript 2.1+.
- New: Added an
existsAsyncmethod toCollectionthat uses aselect count(1) from c where...query to determine more efficiently if any documents exist that match given ID or properties. - New: Added
pathproperties toDatabaseandCollection, which can be used with the underlying Node.js API (throughClient.documentClient) if needed. - New: Most methods now accept an
optionsparameter to forward feed and/or request options to the underlying Node.js API (e.g. forenableCrossPartitionQuery). - Improved: Where possible, document IDs are now used to locate document resources instead of mandatory
_selflinks. This allows for a new overload of thedeleteDocumentAsyncmethod that just takes an ID, and removes the need for a query infindDocumentAsyncif an ID is passed in (either as a property or as a single parameter). Also,storeDocumentAsyncwithStoreMode.UpdateOnlyno longer requires a_selfproperty, anidproperty will do. - Improved: More accurate types for objects passed to and/or returned from
Collectionmethods. E.g. query results generated byqueryDocumentsno longer automatically include document properties such asidand_self, because queries may not actually return full documents anyway (or a document at all, e.g. forselect value...queries). This is a breaking change since the TypeScript compiler may no longer find these properties on result objects, even forselect *queries. ThefindDocumentAsyncandqueryDocumentsmethods now accept a type parameter to specify a result type explicitly. - Changed: Getting
Client.documentClientnow throws an exception if the client connection has not been opened yet, or has been closed. UseisOpen()to check if the connection is currently open. - Fixed: Operations are now queued properly in
DocumentStream, e.g. calling.read()twice in succession (synchronously) actually returns promises for two different results. - Fixed: Added
strictNullChecksandnoImplicitAnyto the TypeScript configuration for compatibility with projects that have these options enabled. - Fixed: Added TypeScript as a development dependency to
package.json.