Skip to content

Commit dd7f4e0

Browse files
committed
chore: remove todo
1 parent 68f2e4b commit dd7f4e0

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

packages/mongo/src/lib/MongoProvider.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -597,17 +597,10 @@ export class MongoProvider<StoredValue = unknown> extends JoshProvider<StoredVal
597597
return payload;
598598
}
599599

600-
// Due to the use of $sample, the output will never have duplicates
601600
public async [Method.Random](payload: Payload.Random<StoredValue>): Promise<Payload.Random<StoredValue>> {
602601
let { count, unique } = payload;
603602
const size = await this.collection.countDocuments({});
604603

605-
// TODO: @dan-online fix this yourself idk how this work
606-
// Basically just this:
607-
// if(unique && size < count) throw InvalidCount
608-
// if (size === 0) throw MissingData
609-
// Also try no to get an infinite loop with unique off and count > size
610-
611604
if (unique && size < count) {
612605
payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.Random }, { size }));
613606

0 commit comments

Comments
 (0)