@nodescript/adapter-mongodb-protocol
Advanced tools
Comparing version 0.1.2 to 1.0.0
import { DomainDef } from '@nodescript/protocomm'; | ||
import { MongoAggregate } from '../schema/MongoAggregate.js'; | ||
import { MongoDocument } from '../schema/MongoDocument.js'; | ||
@@ -6,2 +7,3 @@ import { MongoFilter } from '../schema/MongoFilter.js'; | ||
import { MongoSort } from '../schema/MongoSort.js'; | ||
import { MongoUpdate } from '../schema/MongoUpdate.js'; | ||
export interface MongoDomain { | ||
@@ -28,3 +30,61 @@ connect(req: { | ||
}>; | ||
insertOne(req: { | ||
collection: string; | ||
document: MongoDocument; | ||
}): Promise<{ | ||
insertedId: string; | ||
}>; | ||
insertMany(req: { | ||
collection: string; | ||
documents: MongoDocument[]; | ||
}): Promise<{ | ||
insertedIds: string[]; | ||
}>; | ||
updateOne(req: { | ||
collection: string; | ||
filter: MongoFilter; | ||
update: MongoUpdate; | ||
upsert: boolean; | ||
}): Promise<{ | ||
matchedCount: number; | ||
modifiedCount: number; | ||
upsertedId?: string; | ||
}>; | ||
updateMany(req: { | ||
collection: string; | ||
filter: MongoFilter; | ||
update: MongoUpdate; | ||
}): Promise<{ | ||
matchedCount: number; | ||
modifiedCount: number; | ||
}>; | ||
replaceOne(req: { | ||
collection: string; | ||
filter: MongoFilter; | ||
replacement: MongoDocument; | ||
upsert: boolean; | ||
}): Promise<{ | ||
matchedCount: number; | ||
modifiedCount: number; | ||
upsertedId?: string; | ||
}>; | ||
deleteOne(req: { | ||
collection: string; | ||
filter: MongoFilter; | ||
}): Promise<{ | ||
deletedCount: number; | ||
}>; | ||
deleteMany(req: { | ||
collection: string; | ||
filter: MongoFilter; | ||
}): Promise<{ | ||
deletedCount: number; | ||
}>; | ||
aggregate(req: { | ||
collection: string; | ||
pipeline: MongoAggregate[]; | ||
}): Promise<{ | ||
documents: MongoDocument[]; | ||
}>; | ||
} | ||
export declare const MongoDomain: DomainDef<MongoDomain>; |
@@ -0,1 +1,2 @@ | ||
import { MongoAggregateSchema } from '../schema/MongoAggregate.js'; | ||
import { MongoDocumentSchema } from '../schema/MongoDocument.js'; | ||
@@ -5,2 +6,3 @@ import { MongoFilterSchema } from '../schema/MongoFilter.js'; | ||
import { MongoSortSchema } from '../schema/MongoSort.js'; | ||
import { MongoUpdateSchema } from '../schema/MongoUpdate.js'; | ||
export const MongoDomain = { | ||
@@ -20,5 +22,3 @@ name: 'Mongo', | ||
collection: { type: 'string' }, | ||
filter: { | ||
...MongoFilterSchema.schema, | ||
}, | ||
filter: MongoFilterSchema.schema, | ||
projection: { | ||
@@ -40,5 +40,3 @@ ...MongoProjectionSchema.schema, | ||
collection: { type: 'string' }, | ||
filter: { | ||
...MongoFilterSchema.schema, | ||
}, | ||
filter: MongoFilterSchema.schema, | ||
projection: { | ||
@@ -68,2 +66,110 @@ ...MongoProjectionSchema.schema, | ||
}, | ||
insertOne: { | ||
type: 'command', | ||
params: { | ||
collection: { type: 'string' }, | ||
document: MongoDocumentSchema.schema, | ||
}, | ||
returns: { | ||
insertedId: { type: 'string' }, | ||
} | ||
}, | ||
insertMany: { | ||
type: 'command', | ||
params: { | ||
collection: { type: 'string' }, | ||
documents: { | ||
type: 'array', | ||
items: MongoDocumentSchema.schema | ||
}, | ||
}, | ||
returns: { | ||
insertedIds: { | ||
type: 'array', | ||
items: { type: 'string' }, | ||
}, | ||
} | ||
}, | ||
updateOne: { | ||
type: 'command', | ||
params: { | ||
collection: { type: 'string' }, | ||
filter: MongoFilterSchema.schema, | ||
update: MongoUpdateSchema.schema, | ||
upsert: { type: 'boolean' }, | ||
}, | ||
returns: { | ||
matchedCount: { type: 'number' }, | ||
modifiedCount: { type: 'number' }, | ||
upsertedId: { | ||
type: 'string', | ||
optional: true, | ||
}, | ||
} | ||
}, | ||
updateMany: { | ||
type: 'command', | ||
params: { | ||
collection: { type: 'string' }, | ||
filter: MongoFilterSchema.schema, | ||
update: MongoUpdateSchema.schema, | ||
}, | ||
returns: { | ||
matchedCount: { type: 'number' }, | ||
modifiedCount: { type: 'number' }, | ||
} | ||
}, | ||
replaceOne: { | ||
type: 'command', | ||
params: { | ||
collection: { type: 'string' }, | ||
filter: MongoFilterSchema.schema, | ||
replacement: MongoDocumentSchema.schema, | ||
upsert: { type: 'boolean' }, | ||
}, | ||
returns: { | ||
matchedCount: { type: 'number' }, | ||
modifiedCount: { type: 'number' }, | ||
upsertedId: { | ||
type: 'string', | ||
optional: true, | ||
}, | ||
} | ||
}, | ||
deleteOne: { | ||
type: 'command', | ||
params: { | ||
collection: { type: 'string' }, | ||
filter: MongoFilterSchema.schema, | ||
}, | ||
returns: { | ||
deletedCount: { type: 'number' }, | ||
} | ||
}, | ||
deleteMany: { | ||
type: 'command', | ||
params: { | ||
collection: { type: 'string' }, | ||
filter: MongoFilterSchema.schema, | ||
}, | ||
returns: { | ||
deletedCount: { type: 'number' }, | ||
} | ||
}, | ||
aggregate: { | ||
type: 'command', | ||
params: { | ||
collection: { type: 'string' }, | ||
pipeline: { | ||
type: 'array', | ||
items: MongoAggregateSchema.schema, | ||
}, | ||
}, | ||
returns: { | ||
documents: { | ||
type: 'array', | ||
items: MongoDocumentSchema.schema, | ||
} | ||
} | ||
}, | ||
}, | ||
@@ -70,0 +176,0 @@ events: {}, |
export * from './domains/MongoDomain.js'; | ||
export * from './protocol.js'; | ||
export * from './schema/MongoAggregate.js'; | ||
export * from './schema/MongoDocument.js'; | ||
@@ -6,2 +8,2 @@ export * from './schema/MongoFilter.js'; | ||
export * from './schema/MongoSort.js'; | ||
export * from './protocol.js'; | ||
export * from './schema/MongoUpdate.js'; |
export * from './domains/MongoDomain.js'; | ||
export * from './protocol.js'; | ||
export * from './schema/MongoAggregate.js'; | ||
export * from './schema/MongoDocument.js'; | ||
@@ -6,3 +8,3 @@ export * from './schema/MongoFilter.js'; | ||
export * from './schema/MongoSort.js'; | ||
export * from './protocol.js'; | ||
export * from './schema/MongoUpdate.js'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@nodescript/adapter-mongodb-protocol", | ||
"version": "0.1.2", | ||
"version": "1.0.0", | ||
"description": "MongoDb Adapter Protocol", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
17493
28
340
1