Closed lavarsicious closed 7 years ago
Hello,
As of v1.1.0 I've noticed that nested document arrays are no longer returned as actual arrays. I've created pull request https://github.com/mblarsen/mongoose-hidden/pull/29 that adds a test for this scenario.
The test, "A test for a document with a collection of nested documents" passes in versions prior to 1.1.0 but after https://github.com/mblarsen/mongoose-hidden/commit/bf74c77794590b1550ec43ba7736a833f42374d4 it seems that arrays are now returned as objects with indexes as keys.
Version 1.0.0:
{ "name": "Joe", "email": "joe@example.com", "companies": [ { "name": "GOGGLE", "code": "GOG" }, { "name": "APPLE", "code": "APL" } ] }
Version 1.1.0:
{ "name": "Joe", "email": "joe@example.com", "companies": { "0": { "name": "GOGGLE", "code": "GOG" } } }
Thanks!
Hi @lavarsicious I'll look into it tomorrow. Thanks a lot for the test case.
@lavarsicious did you ever get to try new version?
@mblarsen Yes! 1.2.0 is working as expected, thank you.
Hello,
As of v1.1.0 I've noticed that nested document arrays are no longer returned as actual arrays. I've created pull request https://github.com/mblarsen/mongoose-hidden/pull/29 that adds a test for this scenario.
The test, "A test for a document with a collection of nested documents" passes in versions prior to 1.1.0 but after https://github.com/mblarsen/mongoose-hidden/commit/bf74c77794590b1550ec43ba7736a833f42374d4 it seems that arrays are now returned as objects with indexes as keys.
Version 1.0.0:
Version 1.1.0:
Thanks!