Questions tagged [gridfs-stream]

gridfs-stream is a node.js module that provides streams for writing to and reading from GridFS on MongoDB.

For more information, visit gridfs-stream's github repository.

160 questions
0
votes
0 answers

Making use of a custom API route to upload audio data to GridFS in NextJS

I am working on a NextJS small app, called njs-voice-rcd, where I want to upload some voice recording made by the user to a mongo DB using GridFS. At this point I have the voice recording part already working as expected. But (after various trials)…
Michel
  • 10,303
  • 17
  • 82
  • 179
0
votes
0 answers

Audio upload to GridFS in a NextJS app not working

I am working on a NextJS test app, called njs-voice-rcd, where I want to upload some voice recording made by the user to a mongo DB using GridFS. At this point I have the voice recording part already working as expected. But I can't figure out the…
Michel
  • 10,303
  • 17
  • 82
  • 179
0
votes
0 answers

Handling audio data in Next JS

I am working on a Next JS app, now trying to make a test component to figure out how to upload an audio file from the file system to a mongo DB using GridFS. The component hereafter is meant to do that, but it is not working. Can someone see what I…
Michel
  • 10,303
  • 17
  • 82
  • 179
0
votes
1 answer

How to get the filename of a mongodb GridFS file given its id?

What if I know the mongo id of a file stored in gridFS, and want to download it under the filename that is stored in its fs.files filename field? I don't have a model to call the collection with, so I'm confused how I'm supposed to do a query on…
Ruo
  • 77
  • 7
0
votes
1 answer

How to get absolute path of a file upload in React and send it to MongoDB?

I'm trying to upload files to MongoDB with react, and I'm struggling to get the absolute path in order to use GridFS to store the file. In the backend, I have a route for AddFile defined as such: const addFile = async (req, res) => { const {…
Ruo
  • 77
  • 7
0
votes
0 answers

MongoDB GridFS not behaving as expected

I am trying to integrate the following packages to create an API that saves files into MongoDB. mongodb, multer, multer-gridfs-storage, gridfs-stream. (I am using mongodb driver and not mongoose) I've used the following code to establish the…
Swordax
  • 3
  • 1
  • 1
0
votes
1 answer

GridFS pipe readable stream and return _id of streamed document

I am trying to get back the _id of a document that has been streamed to MongoDB via GridFS. Is there a way to do this? The code is very simple. I am running the following to insert the document into…
Robert
  • 176
  • 1
  • 12
0
votes
1 answer

TypeError: Cannot read properties of undefined (reading 'findOne') node js gridFS

I have gfs method to get images from mongoDB, the code was working fine when it was at main app.js but when I tried to move it to a folder it returns TypeError: Cannot read properties of undefined (reading 'findOne') my images/mongoose model: const…
0
votes
0 answers

How do I initialize client for use with GridFS?

MongoDB's GridFS is not working I'm trying to set up a gridFS project, and when I try to use "npm start", I get this error message: const db = client.db(lcredux); ^ ReferenceError: client is not defined For reference, this is the code…
Rob Lee
  • 11
  • 1
0
votes
0 answers

How to download a pdf file (stream) from GridJs

Im trying to download a pdf file stored in mongodb using gridfs andmulter , I am recieving a stream back which when I downloaded and open the pdf file would be corrupted here is my backend for downloading it [My backend is node js and frontend is…
0
votes
1 answer

Download multiple files(stored in a database) in a zip in java

How to download multiple files in a zip folder. I am using spring-boot and documents are saved in MongoDB using GridFS. I was trying to download using FileSystemResource which takes File as an argument taking reference from…
Bifrost
  • 417
  • 5
  • 23
0
votes
1 answer

gfs.files.findOne(): cannot find files of undefined

Actually, I want to use gfs variable outside of the function. But I'm getting undefined. I'm using Node.js for the back-end and using Express.js framework. Please take a quick look at what I'm doing. const mongoose = require("mongoose"); // Version…
0
votes
1 answer

what is the best approach to retrieve images from MongoDB?

I have a web application that stores and retrieves images from MongoDB using GridFS. My issue is that when the user makes a request that prompts the server to retrieve images from the database, it takes a very long time. For instance, a request that…
Diego
  • 386
  • 4
  • 19
0
votes
1 answer

Streaming MP4 using GridFS,NodeJS and react - getting 206 partial content error

I am working on my streaming project for quite sometime. Everything works great, however I am getting 206 err partial content when streaming is done for large MP4 files. I do understand why is that I researched a ton and it appears to be a bug in…
Oyosied
  • 43
  • 7
0
votes
1 answer

MongoDB GridFs: grid.mongo.ObjectID is not a constructor

i´m working with mongoDB GridFs, node.js and express. Currently im trying to get the file from the database but for some reason i get this error TypeError: grid.mongo.ObjectID is not a constructor UploadController.ts export default class…
Miguel Frias
  • 2,544
  • 8
  • 32
  • 53