Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sub collection #2

Closed
dfdgsdfg opened this issue Dec 5, 2019 · 2 comments
Closed

Support sub collection #2

dfdgsdfg opened this issue Dec 5, 2019 · 2 comments

Comments

@dfdgsdfg
Copy link
Contributor

dfdgsdfg commented Dec 5, 2019

Seems not support nested sub collection.

firestore = MockFirestoreInstance();
      await firestore
          .collection('userProfiles')
          .document('a')
          .collection('relationship')
          .document('1')
          .setData(relationship1);
      await firestore
          .collection('userProfiles')
          .document('a')
          .collection('relationship')
          .document('2')
          .setData(relationship2);
      await firestore
          .collection('userProfiles')
          .document('a')
          .collection('relationship')
          .document('3')
          .setData(relationship3);
      await firestore
          .collection('userProfiles')
          .document('a')
          .collection('relationship')
          .document('4')
          .setData(relationship4);

      relsApi.allRelationships('a').listen(expectAsync1((rs) {
        print(rs.map((r) => r.relId));  // -> (1, 1, 1, 1) should be(1,2,3,4)
        expect(rs.length, equals(4)); 
      }));
atn832 added a commit that referenced this issue Dec 10, 2019
@atn832
Copy link
Owner

atn832 commented Dec 10, 2019

Can you share the actual code for relsApi.allRelationships? I tried implementing something similar and it worked as expected. print(firebase.dump()) returned the following:

{
  "userProfiles": {
    "a": {
      "relationship": {
        "1": {
          "label": "relationship1"
        },
        "2": {
          "label": "relationship2"
        }
      }
    }
  }
}

@dfdgsdfg
Copy link
Contributor Author

It's my mistake.

Everything is just fine.

Thanks for your superb works. 👍 👍 💯 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants