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
1 answer

Creating a READSTREAM in GFS is throwing an error, does not seem catchable

I am setting up an up/download and have used several resources. I need to be able to store the "files" in the Mongo datastore and then read them back out. I was able to upload, but downloading is through an error when I try to instantiate the…
0
votes
1 answer

Multer GridFS Storage File Upload With Association To Mongoose Schema

I can upload a file to my MongoDB using multer-gridfs-storage, but I am having trouble associating the file with my "customer" schema. Basically, each customer should have three types of files: Network, email, and password files. Each file will be a…
0
votes
1 answer

How to use openUploadStream with Grid-fs bucket

I would like to use a mongodb model with the GridFSBucket. I realized that you can use the metadata with GridFSUploadOptions, and it seems to function as the model in this case, but i get an error, "TypeError: mongodb.GridFSUploadOptions is not a…
0
votes
1 answer

Playing audio - React / NodeJS / MongoDB- GridFS

i have the following project structure: NodeJS is my back-end: used for upload .mp3 on my mongodb and stream this. I used GridFsBucket for upload/stream React is my front-end and work with Redux store: so, i've two pages, first for upload .mp3 file…
act-studio
  • 51
  • 1
  • 2
  • 10
0
votes
2 answers

Can not access objects key value pairs

I am sending images via FormData from my VueJS FrontEnd to my Express Server to store them in a Mongo DB with gridfs-stream and mongoose. The image objects arrive to the server but I don´t know how I access its key-value pairs. When I ran let part…
0
votes
2 answers

Download files from GridFS Stream NodeJS Backend / React Front End

I've set up a GridFS stream that serves zip files, if I type in the API url in the browser the zip file downloads onto my computer, which is what I want to happen. However when I do a get request from the front end React app, I get back a data…
Dmitriy
  • 1,211
  • 1
  • 11
  • 28
0
votes
0 answers

MongoDB GridFS, downloading image always returning only last image from a set of images

I am trying to retreive a set of images stored in mongoDB using mongoose and GridFS. I'm storing the filenames in an array and looping to retreive each one and store it in a local path. However, only the last image is downloaded and stored, the loop…
Mithil Mohan
  • 223
  • 2
  • 11
0
votes
1 answer

Display video from Gridfs storage in react app

I am using multer-gridfs-storage and gridfs-stream to store my video in the backend (Express/Node). When I try to retrieve the file to play on my front end (React) the player refuses to recognize the source. I am using Video-React to display the…
kvnam
  • 1,285
  • 2
  • 19
  • 34
0
votes
2 answers

Is it possible using function doesn't exists?

When I print let app = express() on console it prints like this. { [EventEmitter: app] _events: { mount: [Function: onmount] }, _eventsCount: 1, _maxListeners: undefined, setMaxListeners: [Function: setMaxListeners], getMaxListeners:…
JillAndMe
  • 3,989
  • 4
  • 30
  • 57
0
votes
1 answer

Mongodb: getting a large file using stream

I'm using grid-stream and girdFsStorage library for getting image from mongodb. I uploaded image to db was okay, but when I tried to get image from db failed. I expected db.collection at gfs.files.findOne({ filename: req.params.filename }, (err,…
JillAndMe
  • 3,989
  • 4
  • 30
  • 57
0
votes
1 answer

How do I post a plain file buffer instead of binary-encoded-file when posting with nodejs/npm's request package?

I am using npm's request package to do a post of a file-buffer to a REST api written using meteor.js restivus package. My node.js client code that posts to the api is as follows: url =…
yusha uzumo
  • 211
  • 1
  • 4
  • 15
0
votes
2 answers

mongodb topology.s.promiseLibrary is undefined

I'm using mongodb in node.js with Gridfs and I encounter TypeError: Promise is not a constructor on this line. I've traced this back a little bit, and I can see that on this line, topology.s.promiseLibrary is undefined. I don't know what I could…
Wyck
  • 10,311
  • 6
  • 39
  • 60
0
votes
0 answers

gridfs-stream Image post generated collections but request never finishes

I am trying to upload an image to my MongoDB. I'm using Mongoose, gridfs-stream and some other packages I was told to install (I'm relatively new to the whole MEAN ecosystem) The request seems to go through fine, and the collections used for…
geolaw
  • 412
  • 1
  • 12
  • 26
0
votes
1 answer

How to use monk initiated mongoDB instance in gridfs-stream?

I'm using gridfs-stream. In the docs there is an example for a mongodb native DB: // create or use an existing mongodb-native db instance. var db = new mongo.Db('yourDatabaseName', new mongo.Server("127.0.0.1", 27017)) // make sure the db instance…
user3142695
  • 15,844
  • 47
  • 176
  • 332
0
votes
1 answer

How to open mongoDB instance in a javascript class?

I've created a DB class using a mongoDB connection, but I don't know how to open a db instance in this context. import mongo from 'mongodb' import Grid from 'gridfs-stream' export default class Db { constructor () { this.connection = new…
user3142695
  • 15,844
  • 47
  • 176
  • 332