Open eriknyk opened 7 years ago
This looks like a bug because you should be able to know what the name is if you're returning the documents. We might have to add a output type of none
or object
.
For a quick fix to get your stuff working you can changed line 121 to be const parsed = documents
. This will disable all other formats, and just return an object. Then you can access the name through result[0].__name
. It's not a long term solution but it will get you up and running quickly.
It looks like you're just trying to upload documents to mongo db. It might be easier if you just create a PR that adds support for mongo db. You should be able to duplicate the couchbase output and convert it to mongo db.
Over the next couple months we will be working on making major improvements to fakeit by adding support for plugins which this would be a great use case for a plugin so we will keep this in mind when creating the initial plugins.
If I have 2 models
a.yaml
andb,yaml
and if I execute:
data is an array like:
The question here is, how I can determine which array position is what to be used?
I mean my
a.yaml
file has definedand
b.yaml
I need a way to get it something like this:
Note.- Syntax is only a example like: pseudo-code
Actually there is no way to archive this, because it returns an array of strings and there is no way to know what serialized result is for what source name,
Regards.