Laravel-mongodb: [Question] How to import from an exported json?

Created on 20 May 2020  路  4Comments  路  Source: jenssegers/laravel-mongodb

I exported some documents from a collection using mongodump.

I need a way to import into my collection after a db reset.

Is there a way to load the json and directly add all its content to collection?

question

All 4 comments

You can use mongorestore. See docs

OMG. I should explicitly say that I want use your library... I am asking here for a reason !

@realtebo i didn't see reason in your question
If you can load blob file(maybe json, maybe tar) directly using default work of this library, you can parse blob file and using work with Eloquent model or collection
This library dont't have mechanism to load blob files into collections

Ok, good to know, I was only looking for this info. It's not possible. ok.

Was this page helpful?
0 / 5 - 0 ratings