Update to Readme.md. Correct call `client.databases.create` (#99)
Fixes readme file to call `client.databases.create` instead of `client.database.create`. Also fixes test names that may be confusing.
This commit is contained in:
Родитель
4d9af8d915
Коммит
6d6f9a5e05
|
@ -17,10 +17,10 @@ const collectionDefinition = { id: "sample collection" };
|
||||||
const itemDefinition = { id: "hello world doc", content: "Hello World!" };
|
const itemDefinition = { id: "hello world doc", content: "Hello World!" };
|
||||||
|
|
||||||
async function helloCosmos() {
|
async function helloCosmos() {
|
||||||
const { database: db } = await client.database.create(databaseDefinition);
|
const { database: db } = await client.databases.create(databaseDefinition);
|
||||||
console.log('created db');
|
console.log('created db');
|
||||||
|
|
||||||
const { container } = await db.container.create(collectionDefinition);
|
const { container } = await db.containers.create(collectionDefinition);
|
||||||
console.log('created collection');
|
console.log('created collection');
|
||||||
|
|
||||||
const { body } = await container.items.create(documentDefinition);
|
const { body } = await container.items.create(documentDefinition);
|
||||||
|
|
|
@ -426,11 +426,11 @@ describe("NodeJS CRUD Tests", function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("container.createIfNotExists", function() {
|
describe("containers.createIfNotExists", function() {
|
||||||
let database: Database;
|
let database: Database;
|
||||||
before(async function() {
|
before(async function() {
|
||||||
// create database
|
// create database
|
||||||
database = await getTestDatabase("container.createIfNotExists");
|
database = await getTestDatabase("containers.createIfNotExists");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should handle container does not exist", async function() {
|
it("should handle container does not exist", async function() {
|
||||||
|
|
|
@ -55,7 +55,7 @@ describe("NodeJS CRUD Tests", function() {
|
||||||
await databaseCRUDTest();
|
await databaseCRUDTest();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("database.createIfNotExists", function() {
|
describe("databases.createIfNotExists", function() {
|
||||||
it("should handle does not exist", async function() {
|
it("should handle does not exist", async function() {
|
||||||
const def: DatabaseDefinition = { id: addEntropy("does not exist") };
|
const def: DatabaseDefinition = { id: addEntropy("does not exist") };
|
||||||
const { database } = await client.databases.createIfNotExists(def);
|
const { database } = await client.databases.createIfNotExists(def);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче