File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -112,15 +112,15 @@ public static async Task Run(string input)
112
112
``` javascript
113
113
const cosmos = require (' @azure/cosmos' );
114
114
const endpoint = process .env .COSMOS_API_URL ;
115
- const masterKey = process .env .COSMOS_API_KEY ;
115
+ const key = process .env .COSMOS_API_KEY ;
116
116
const { CosmosClient } = cosmos;
117
117
118
- const client = new CosmosClient ({ endpoint, auth : { masterKey } });
118
+ const client = new CosmosClient ({ endpoint, key });
119
119
// All function invocations also reference the same database and container.
120
120
const container = client .database (" MyDatabaseName" ).container (" MyContainerName" );
121
121
122
122
module .exports = async function (context ) {
123
- const { result : itemArray } = await container .items .readAll ().toArray ();
123
+ const { resources : itemArray } = await container .items .readAll ().fetchAll ();
124
124
context .log (itemArray);
125
125
}
126
126
```
You can’t perform that action at this time.
0 commit comments