Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

How to use ReactNative SDK with flexible sync using a code first approach

+1
−0

I am working on a React Native app using Realm, Atlas Flexible Sync, and MongoDB, and I'm super confused about how subscriptions work. I'm coming from a .NET SQL background, so I'm completely new to this type of architecture. I've been reading MongoDB's documentation for the React Native SDK and Atlas Sync for roughly a month, and I'm still lost.

On the backend I have my cluster set up with a database and an app synced with Flexible Sync. I have created my schemas on the client side and am trying to initialize them in Atlas, and maybe seed some data when the application first runs. Flexible sync says that you have to create a subscription to do this.

And a subscription seems to be some kind of query, that creates a queryable field that some specific user can now access. From the examples I've seen, I don't understand if I have to open a synced Realm for every query, or if I can just read and write to Realm normally and it will Sync changes up to Atlas. I basically just want data to be partitioned by who created a document and the custom user role that I added to them.

Do I even need to use flexible sync for this, or can I just use partitioned based sync and specify all of my permissions for the user types on the backend?

I really just want to migrate my schemas to Atlas with a code first approach, and then write my read and write operations as normal without having to create a different subscription each time. Any advice and can anyone explain to me how this works and what subscriptions actually are?

History
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

0 answers

Sign up to answer this question »