0

I have a users collection where each user has a bunch of properties

users: {
 <userid>: {
    name: "",
    email: "",
    photo: "",
    lastLogin: ""
 }
}

With that structure, I want to build a search functionality in my app where a user can search for other users.

What I want is for the users collection to be available on the client for searching/filtering but minus the lastLogin attribute of each user. That is more like a private attribute.

How does one go about doing that? I literally dont want that attribute to even be sent over the wire.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Rajat
  • 32,970
  • 17
  • 67
  • 87
  • what about storing lastLogin in a separate node, i.e. in other subtree than users are stored – pkacprzak Aug 26 '16 at 23:29
  • 1
    You'll have to split the public and private data into separate branches of the tree. See http://stackoverflow.com/questions/38921824/how-to-create-public-private-user-profile-with-firebase-security-rules/38923745#38923745 – Frank van Puffelen Aug 27 '16 at 04:24
  • Thanks @FrankvanPuffelen for pointing to the right resource. – Rajat Aug 29 '16 at 21:08

0 Answers0