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
id
property, 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
readDocument
API, using the ID), but an error is thrown upon checking thebar
property.
Bug fixes
v1.0.0
- Important: This version now requires TypeScript 2.1+.
- New: Added an
existsAsync
method toCollection
that uses aselect count(1) from c where...
query to determine more efficiently if any documents exist that match given ID or properties. - New: Added
path
properties toDatabase
andCollection
, which can be used with the underlying Node.js API (throughClient.documentClient
) if needed. - New: Most methods now accept an
options
parameter 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
_self
links. This allows for a new overload of thedeleteDocumentAsync
method that just takes an ID, and removes the need for a query infindDocumentAsync
if an ID is passed in (either as a property or as a single parameter). Also,storeDocumentAsync
withStoreMode.UpdateOnly
no longer requires a_self
property, anid
property will do. - Improved: More accurate types for objects passed to and/or returned from
Collection
methods. E.g. query results generated byqueryDocuments
no longer automatically include document properties such asid
and_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. ThefindDocumentAsync
andqueryDocuments
methods now accept a type parameter to specify a result type explicitly. - Changed: Getting
Client.documentClient
now 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
strictNullChecks
andnoImplicitAny
to the TypeScript configuration for compatibility with projects that have these options enabled. - Fixed: Added TypeScript as a development dependency to
package.json
.