Firestore: how to perform a query with inequality / not equals

后端 未结 7 1814
南笙
南笙 2020-11-22 05:05

I want select from Firestore collection just articles written NOT by me.
Is it really so hard?

Every article has field "owner_uid".

7条回答
  •  天命终不由人
    2020-11-22 05:43

    1. Track all user id in a single document (or two)

    2. filter unwanted id out

    3. Use "where in"

    
    var mylistofidwherenotme =  // code to fetch the single document where you tracked all user id, then filter yourself out
    
    
    database.collection("articles").where("blogId", "in", mylistofidwherenotme)
    
    

提交回复
热议问题