mirror of
https://github.com/wekan/wekan.git
synced 2026-03-07 22:22:33 +01:00
Hello gridfs lib + fsHooks for mongodb bucket storage
This commit is contained in:
parent
ee2ffc616a
commit
f650a17cd8
5 changed files with 128 additions and 0 deletions
9
models/lib/grid/createBucket.js
Normal file
9
models/lib/grid/createBucket.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { MongoInternals } from 'meteor/mongo';
|
||||
|
||||
export const createBucket = bucketName => {
|
||||
const options = bucketName ? { bucketName } : void 0;
|
||||
return new MongoInternals.NpmModule.GridFSBucket(
|
||||
MongoInternals.defaultRemoteCollectionDriver().mongo.db,
|
||||
options,
|
||||
);
|
||||
};
|
||||
4
models/lib/grid/createObjectId.js
Normal file
4
models/lib/grid/createObjectId.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
import { MongoInternals } from 'meteor/mongo';
|
||||
|
||||
export const createObjectId = ({ gridFsFileId }) =>
|
||||
new MongoInternals.NpmModule.ObjectID(gridFsFileId);
|
||||
Loading…
Add table
Add a link
Reference in a new issue