Support GridFS [moved]
See original GitHub issueThis is Issue 153 moved from a Google Code project. Added by 2010-11-02T17:41:54.000Z by scotthernandez. Please review that bug for more context and additional comments, but update this bug.
Original labels: Type-Enhancement, Priority-Low, Milestone-Release1.0
Original description
There are two ways I can see supporting gridfs.
1.) Add a special type/annotation that can be used as a reference to a gridfs file (by path or _id)
class HasAFileRef {
@Id ObjectId id;
@GridFS OutputStream/GridFSDBFile/byte[] gridFsFile;
...
}
2.) Wrap a class as the gridfsfile.metadata fields.
@GridFsFile
class IsAFile {
@Id ObjectId id;
String field1; // maps to metadata.field1
...
[GridFSFile gfsFile;]
}
Issue Analytics
- State:
- Created 10 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
GridFS — MongoDB Manual
GridFS is a specification for storing and retrieving files that exceed the BSON-document size limit ... GridFS does not support multi-document transactions.
Read more >GridFS and Cloning to another server - Stack Overflow
I have a local MongoDB database that I am starting to put some files into GridFS for caching purposes. What I want to...
Read more >GridFS API - GitHub Pages
The MongoDB Node.js driver now supports a stream-based API for GridFS that's compatible with Node.js' streams3, so you can .pipe() directly from file ......
Read more >Support for GridFS - Google Groups
MongoDB and. Mongoose to persist user data and picture metadata. We are planning to move our pictures from the filesystem into mongo's
Read more >Howto migrate the files from gridfs to filesystem
Not tested… purely psuedo · Set your file store to filesystem and set your folder. · Then export all of the files from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
are there any updates on this?
Thanks! I misinterpreted your last message as if Morphia had already some support to map files to entities. This is the use case I have right now:
This is a JPA-mapped entity which uses the
Blob
type to read from database, i.e.data.getBinaryStream()
which reads from the database (without loading all the bytes in memory).I’m moving from JPA to Morphia and I don’t really know how to migrate this last bit of logic!
It would then be used like: