feat(s3): add S3 create file/folder dialogs and in-place text editor; export mongodb plugin
This commit is contained in:
@@ -21,15 +21,9 @@ export async function registerMongoHandlers(
|
||||
|
||||
// Helper to create ObjectId filter
|
||||
const createIdFilter = (documentId: string) => {
|
||||
// Try to treat as ObjectId string - MongoDB driver will handle conversion
|
||||
try {
|
||||
// Import ObjectId from the mongodb package that smartdata uses
|
||||
const { ObjectId } = require('mongodb');
|
||||
if (ObjectId.isValid(documentId)) {
|
||||
return { _id: new ObjectId(documentId) };
|
||||
}
|
||||
} catch {
|
||||
// Fall through to string filter
|
||||
const { ObjectId } = plugins.mongodb;
|
||||
if (ObjectId.isValid(documentId)) {
|
||||
return { _id: new ObjectId(documentId) };
|
||||
}
|
||||
return { _id: documentId };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user