Comments (9)
@rchan I'm assuming you retrieve the variables after the user has logged in?
I'm currently writing compatibility for any arbitrary variable to be passed on dispatch('openDBChannel')
. Please hold on.
from vuex-easy-firestore.
@rchan
I have made this possible through custom variables passed as parameter like so: dispatch('module/openDBChannel', {customVar: customId})
.
Please update to npm i [email protected]
and check the new documentation here.
Feel free to write additional feedback or comments, or if all good please close this issue!
from vuex-easy-firestore.
Dear Jon.
Thanks for your issue!
I believe it’s possible even now! Just pass the user id as third argument. Doesn’t it work?
I will also do some more tests next week. Keep you posted.
from vuex-easy-firestore.
Oh wait I see. You don’t know the userId
at the time of the settings!
I didn’t have this problem before because I only used the userid in the syncPath myself, not in the where.
So I will make this a possibility this weekend and let you know.
In the meantime I would wanna ask if this doesn’t cause you any security issues on your side? I think this way it's possible for users to edit other user's documents or to even retrieve all docs of all users. How did you set up your security rules in your case?
I have also not yet used 'array-contains' myself, so i'll research that. Either way i'd love some input on your specific use case.
from vuex-easy-firestore.
I have the same issue, although I'm only doing '==' rather than 'array-contains'
We can't have the documents separated under each user because we have an admin side of the app that needs to work on the documents as a single collection
the rule for '==' would be (from example in docs https://firebase.google.com/docs/firestore/security/rules-query)
service cloud.firestore {
match /databases/{database}/documents {
match /stories/{storyid} {
// Only the authenticated user who authored the document can read or write
allow read, write: if request.auth.uid == resource.data.author;
}
}
}
think dealing with 'array-contains' is also possible, but I don't have that to hand at the moment
from vuex-easy-firestore.
@rchan @jonbomme I just pushed version 1.7 which will automatically replace '{userId}'
with the actual userId
at the time you do dispatch('openDBChannel')
. Make sure that you add '{userId}'
just like that as third param of the where filter in sync.where
.
Can you update with npm and let me know how it goes?
Let me know if there are any problems or bugs or feel free to open a new issue with other requests!
from vuex-easy-firestore.
it worked for me
however, possible to to make it any arbitrary variable? for example, one of my applications has members inside a group, so the objects they all need when inside a group would fall under either a database reference of /groups/{groupId}/things or groupId in where clause
from vuex-easy-firestore.
Cool! I will try it out later!
from vuex-easy-firestore.
no time to try it out at the moment, but API wise it would be what I want
from vuex-easy-firestore.
Related Issues (20)
- cannot read resolve of undefined HOT 7
- Feature: Add firestore.getAll() on the web HOT 7
- Question: can we rely on the `signedIn` getter to check if the user is signed in? HOT 3
- Guard 'id' will still add 'id' on update HOT 1
- Reacting to changes in vue-router HOT 1
- Retrieve subcollections together with document HOT 2
- feat(docs): add firestore guide
- RangeError: Maximum call stack size exceeded HOT 6
- ProjectId not provided in firebase.initializeApp despite being provided HOT 3
- Can't get it to work no matter what! HOT 6
- Two-way binding HOT 4
- Getters undefined when working with users collection + sign in onAuthStateChanged [Help]
- fetch only returns id in doc HOT 2
- Update library for firebase v9 HOT 3
- Adding "in" or "array-contains" to the where clause
- setPathVars should be better documented HOT 1
- Doc insertion from multiple apps at he same index
- project build process HOT 1
- E2E test with Cypress
- syncStack / rejects HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vuex-easy-firestore.