Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8e0e8ff
STITCH-2008 - JS location metadata lookup, unit tests to follow
dkaminsky Nov 27, 2018
8e868d2
Merge branch 'master' of github.com:mongodb/stitch-js-sdk into STITCH…
dkaminsky Nov 29, 2018
25bb8ff
STITCH-2008 - review comments from @adamchel
dkaminsky Nov 29, 2018
5985f6b
STITCH-2008 - update package lock and add some debugging for base sti…
dkaminsky Nov 30, 2018
af7874e
STITCH-2008 - add some debugging for base stitch request client
dkaminsky Nov 30, 2018
8a58207
STITCH-2008 - add some debugging for base stitch request client
dkaminsky Nov 30, 2018
e61fa91
STITCH-2008 - add some debugging for base stitch request client
dkaminsky Nov 30, 2018
760a63a
STITCH-2008 - update evergreen mongod to use 4.0.2
dkaminsky Dec 3, 2018
b9c2d34
STITCH-2008 - update evergreen mongod to use 4.0.2
dkaminsky Dec 3, 2018
3c8d0a9
STITCH-2240 - add toArray and soft deprecate asArray
dkaminsky Dec 3, 2018
c8ca60a
Fix logic condition in getAppClient (#178)
jc Nov 27, 2018
d7fb948
STITCH-2229 Change minAge and maxAge from Int to String (#179)
adamchel Nov 27, 2018
6d4299a
STITCH-2214 package modules as CommonJS instead of UMD (#177)
adamchel Nov 27, 2018
ad6e38c
v4.1.0
adamchel Nov 27, 2018
50e8c59
STITCH-2008 - JS location metadata lookup, unit tests to follow
dkaminsky Nov 27, 2018
5a187da
STITCH-2008 - review comments from @adamchel
dkaminsky Nov 29, 2018
dc76ee9
STITCH-2008 - update package lock and add some debugging for base sti…
dkaminsky Nov 30, 2018
58643cd
STITCH-2008 - add some debugging for base stitch request client
dkaminsky Nov 30, 2018
43ec594
STITCH-2008 - add some debugging for base stitch request client
dkaminsky Nov 30, 2018
97afd0b
STITCH-2008 - add some debugging for base stitch request client
dkaminsky Nov 30, 2018
2841718
STITCH-2008 - update evergreen mongod to use 4.0.2
dkaminsky Dec 3, 2018
038e55b
STITCH-2008 - update evergreen mongod to use 4.0.2
dkaminsky Dec 3, 2018
86e320b
STITCH-2240 - add toArray and soft deprecate asArray
dkaminsky Dec 3, 2018
302c975
Merge branch 'STITCH-2240' of github.com:dkaminsky/stitch-js-sdk into…
dkaminsky Dec 3, 2018
7da6cc5
Merge branch 'master' into STITCH-2240
dkaminsky Dec 3, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,16 @@ describe("RemoteMongoClient", () => {
);

let count = 0;
(await coll.find().asArray()).forEach(_ => {
(await coll.find().toArray()).forEach(_ => {
count++;
});
expect(2).toEqual(count);

expect(
(await coll.find().asArray()).find(it => doc1.hello === it.hello)
(await coll.find().toArray()).find(it => doc1.hello === it.hello)
).toBeDefined();

expect([doc1, doc2]).toEqual(await coll.find().asArray());
expect([doc1, doc2]).toEqual(await coll.find().toArray());

const asyncIter = await iter.iterator();
expect(doc1).toEqual(await asyncIter.next());
Expand Down Expand Up @@ -268,7 +268,7 @@ describe("RemoteMongoClient", () => {

await coll.insertMany([doc3, doc4]);
expect(withoutIds([doc1, doc2, doc3, doc4])).toEqual(
withoutIds(await coll.find().asArray())
withoutIds(await coll.find().toArray())
);
});

Expand Down Expand Up @@ -384,7 +384,7 @@ describe("RemoteMongoClient", () => {
expectedDoc1.woof = "meow";
const expectedDoc2 = { woof: "meow" };
expect([expectedDoc1, expectedDoc2]).toEqual(
withoutIds(await coll.find({}).asArray())
withoutIds(await coll.find({}).toArray())
);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,16 @@ export default class RemoteMongoReadOperation<T> {
/**
* Executes the operation and returns the result as an array.
*/
public toArray(): Promise<T[]> {
return this.proxy.toArray();
}

/**
* Executes the operation and returns the result as an array.
* @deprecated Use toArray instead
*/
public asArray(): Promise<T[]> {
return this.proxy.asArray();
return this.toArray();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ export default class CoreRemoteMongoReadOperation<T> {
return this.executeRead().then(res => res[0]);
}

public asArray(): Promise<T[]> {
public toArray(): Promise<T[]> {
return this.executeRead();
}

public asArray(): Promise<T[]> {
return this.toArray();
}

private executeRead(): Promise<T[]> {
return this.service.callFunction(
this.command,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,16 @@ describe("RemoteMongoClient", () => {
);

let count = 0;
(await coll.find().asArray()).forEach(_ => {
(await coll.find().toArray()).forEach(_ => {
count++;
});
expect(2).toEqual(count);

expect(
(await coll.find().asArray()).find(it => doc1.hello === it.hello)
(await coll.find().toArray()).find(it => doc1.hello === it.hello)
).toBeDefined();

expect([doc1, doc2]).toEqual(await coll.find().asArray());
expect([doc1, doc2]).toEqual(await coll.find().toArray());

const asyncIter = await iter.iterator();
expect(doc1).toEqual(await asyncIter.next());
Expand Down Expand Up @@ -268,7 +268,7 @@ describe("RemoteMongoClient", () => {

await coll.insertMany([doc3, doc4]);
expect(withoutIds([doc1, doc2, doc3, doc4])).toEqual(
withoutIds(await coll.find().asArray())
withoutIds(await coll.find().toArray())
);
});

Expand Down Expand Up @@ -384,7 +384,7 @@ describe("RemoteMongoClient", () => {
expectedDoc1.woof = "meow";
const expectedDoc2 = { woof: "meow" };
expect([expectedDoc1, expectedDoc2]).toEqual(
withoutIds(await coll.find({}).asArray())
withoutIds(await coll.find({}).toArray())
);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,16 @@ export default class RemoteMongoReadOperation<T> {
/**
* Executes the operation and returns the result as an array.
*/
public toArray(): Promise<T[]> {
return this.proxy.toArray();
}

/**
* Executes the operation and returns the result as an array.
* @deprecated Use toArray instead
*/
public asArray(): Promise<T[]> {
return this.proxy.asArray();
return this.toArray();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,16 @@ describe("RemoteMongoClient", () => {
);

let count = 0;
(await coll.find().asArray()).forEach(_ => {
(await coll.find().toArray()).forEach(_ => {
count++;
});
expect(2).toEqual(count);

expect(
(await coll.find().asArray()).find(it => doc1.hello === it.hello)
(await coll.find().toArray()).find(it => doc1.hello === it.hello)
).toBeDefined();

expect([doc1, doc2]).toEqual(await coll.find().asArray());
expect([doc1, doc2]).toEqual(await coll.find().toArray());

const asyncIter = await iter.iterator();
expect(doc1).toEqual(await asyncIter.next());
Expand Down Expand Up @@ -268,7 +268,7 @@ describe("RemoteMongoClient", () => {

await coll.insertMany([doc3, doc4]);
expect(withoutIds([doc1, doc2, doc3, doc4])).toEqual(
withoutIds(await coll.find().asArray())
withoutIds(await coll.find().toArray())
);
});

Expand Down Expand Up @@ -384,7 +384,7 @@ describe("RemoteMongoClient", () => {
expectedDoc1.woof = "meow";
const expectedDoc2 = { woof: "meow" };
expect([expectedDoc1, expectedDoc2]).toEqual(
withoutIds(await coll.find({}).asArray())
withoutIds(await coll.find({}).toArray())
);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,16 @@ export default class RemoteMongoReadOperation<T> {
/**
* Executes the operation and returns the result as an array.
*/
public toArray(): Promise<T[]> {
return this.proxy.toArray();
}

/**
* Executes the operation and returns the result as an array.
* @deprecated Use toArray instead
*/
public asArray(): Promise<T[]> {
return this.proxy.asArray();
return this.toArray();
}

/**
Expand Down