import { MongoClient } from "https://deno.land/x/atlas_sdk@v1.0.3/mod.ts";
/**
* @param data_source For example: `Cluster0`
*
* @param filter For example: `{ "_id": "01234" }`
* Find out more at:
* https://www.mongodb.com/docs/manual/reference/method/db.collection.deleteOne/
*/
type MongodbRest = {
endpoint: string;
api_key: string;
};
export async function main(
auth: MongodbRest,
data_source: string,
database: string,
collection: string,
filter: Record<string, any>,
) {
const client = new MongoClient({
endpoint: auth.endpoint,
dataSource: data_source,
auth: { apiKey: auth.api_key },
});
const documents = client.database(database).collection(collection);
return await documents.deleteOne(filter);
}
Submitted by admin 468 days ago
import { MongoClient } from "https://deno.land/x/atlas_sdk@v1.0.3/mod.ts";
/**
* @param data_source For example: `Cluster0`
*
* @param filter For example: `{ "_id": "01234" }`
* Find out more at:
* https://www.mongodb.com/docs/manual/reference/method/db.collection.deleteOne/
*/
type MongodbRest = {
endpoint: string;
api_key: string;
};
export async function main(
auth: MongodbRest,
data_source: string,
database: string,
collection: string,
filter: Record<string, any>
) {
const client = new MongoClient({
endpoint: auth.endpoint,
dataSource: data_source,
auth: { apiKey: auth.api_key },
});
const documents = client.database(database).collection(collection)
return await documents.deleteOne(filter)
}
Submitted by admin 471 days ago
import { Resource } from "https://deno.land/x/windmill@v1.85.0/mod.ts";
import { MongoClient } from "https://deno.land/x/atlas_sdk@v1.0.3/mod.ts";
/**
* @param data_source For example: `Cluster0`
*
* @param filter For example: `{ "_id": "01234" }`
* Find out more at:
* https://www.mongodb.com/docs/manual/reference/method/db.collection.deleteOne/
*/
export async function main(
auth: Resource<"mongodb_rest">,
data_source: string,
database: string,
collection: string,
filter: Record<string, any>
) {
const client = new MongoClient({
endpoint: auth.endpoint,
dataSource: data_source,
auth: { apiKey: auth.api_key },
});
const documents = client.database(database).collection(collection)
return await documents.deleteOne(filter)
}
Submitted by adam186 599 days ago
import { Resource } from "https://deno.land/x/windmill@v1.70.1/mod.ts";
import { MongoClient } from "https://deno.land/x/atlas_sdk@v1.0.3/mod.ts";
/**
* @param data_source For example: `Cluster0`
*
* @param filter For example: `{ "_id": "01234" }`
* Find out more at:
* https://www.mongodb.com/docs/manual/reference/method/db.collection.deleteOne/
*/
export async function main(
auth: Resource<"mongodb_rest">,
data_source: string,
database: string,
collection: string,
filter: Record<string, any>
) {
const client = new MongoClient({
endpoint: auth.endpoint,
dataSource: data_source,
auth: { apiKey: auth.api_key },
});
const documents = client.database(database).collection(collection)
return await documents.deleteOne(filter)
}
Submitted by adam186 634 days ago
import { Resource } from "https://deno.land/x/windmill@v1.55.0/mod.ts";
import { MongoClient } from "https://deno.land/x/atlas_sdk@v1.0.3/mod.ts";
/**
* @param data_source For example: `Cluster0`
*
* @param filter For example: `{ "_id": "01234" }`
* Find out more at:
* https://www.mongodb.com/docs/manual/reference/method/db.collection.deleteOne/
*/
export async function main(
auth: Resource<"mongodb_rest">,
data_source: string,
database: string,
collection: string,
filter: Record<string, any>
) {
const client = new MongoClient({
endpoint: auth.endpoint,
dataSource: data_source,
auth: { apiKey: auth.api_key },
});
const documents = client.database(database).collection(collection)
return await documents.deleteOne(filter)
}
Submitted by adam186 703 days ago
import { Resource } from "https://deno.land/x/windmill@v1.55.0/mod.ts";
import { MongoClient } from "https://deno.land/x/atlas_sdk@v1.0.3/mod.ts";
/**
* @param data_source For example: `Cluster0`
*
* @param filter For example: `{ "_id": "01234" }`
* Find out more at:
* https://www.mongodb.com/docs/manual/reference/method/db.collection.find/
*/
export async function main(
auth: Resource<"mongodb_rest">,
data_source: string,
database: string,
collection: string,
filter: Record<string, any>
) {
const client = new MongoClient({
endpoint: auth.endpoint,
dataSource: data_source,
auth: { apiKey: auth.api_key },
});
const documents = client.database(database).collection(collection)
return await documents.deleteOne(filter)
}
Submitted by adam186 703 days ago