mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Conditions can be used at the top level:
```typescript
db.inventory.find( { $or: [ { quantity: { $lt: 20 } }, { price: 10 } ] } )
```
Seems like the types in `@types/mongoose` marked the conditions as `any`, but exposing this `Condition` would provide for better typing in there as well.
```typescript
findOne(conditions?: any,
callback?: (err: any, res: T | null) => void): DocumentQuery<T | null, T> & QueryHelpers;
findOne(conditions: any, projection: any,
callback?: (err: any, res: T | null) => void): DocumentQuery<T | null, T> & QueryHelpers;
findOne(conditions: any, projection: any, options: any,
callback?: (err: any, res: T | null) => void): DocumentQuery<T | null, T> & QueryHelpers;
```
|
||
|---|---|---|
| .. | ||
| v1 | ||
| v2 | ||
| index.d.ts | ||
| mongodb-tests.ts | ||
| tsconfig.json | ||
| tslint.json | ||