question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Certain Collections Return Empty Object

See original GitHub issue

Great tool, has worked well out of the box. I’m curious if you can shed any light on an issue I’m running into. Most collections I am able to get back up data from, but not all. I created a testing collection, with subCollections and all types of data in it… and everything was gathered properly. For whatever reason, an existing collection that I had defined will not return any information, and I just get an empty object. It only appears to be having troubles with this one collection, which has a subCollection and then another subCollection nested in it.

This is working great. I get information on my newly created testing collection. backups().then((data) => { // parse backup JSON var json = JSON.stringify(data); })

But, when running on my companies collection, I get back an empty object: {"companies":{}}

I can provide more details as needed but wanted to see if you can point me in a direction as to why specific collections return an empty object.

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Cweaver136commented, Mar 24, 2022

Figured it out! Our existing collection was created with deep paths originally, and I guess that doesn’t actually create the top-level documents.

image

Non-Existent Ancestoral Documents don’t show up in queries.

Thanks for your help in the matter, I believe all is well.

0reactions
dalenguyencommented, Mar 24, 2022

Wow, good to know the causes. I’m glad that you figured it out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should an object return null and a collection ... - Stack Overflow
A collection is an object. There are times when an empty object is better than null, and this comes up particularly often with...
Read more >
Collection returns empty object for null relations #1771 - GitHub
If you have a collection with a hasOne relation and you fetch that relation with withRelated on fetchAll the relations that come out...
Read more >
How do I create an empty collection object? - Kode Java
Sometimes you need to return an empty collection from your Java methods. The java.util.Collections utility class have three different static ...
Read more >
Best way to create an empty collection (array and list) in C# ...
As expected, the Array.Empty is clear winner. That makes sense, because it just returns a reference to a static generic class with a...
Read more >
Return an empty array or collection instead of a null
This noncompliant code example returns a null ArrayList when the size of the ArrayList is 0. The class Inventory contains a getStock() method...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found