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.

Post History

60%
+1 −0
Q&A How to use ReactNative SDK with flexible sync using a code first approach

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 t...

0 answers  ·  posted 1y ago by Scriptastrophe‭  ·  last activity 1y ago by Mithical‭

#4: Post edited by user avatar Alexei‭ · 2023-03-08T07:45:38Z (over 1 year ago)
Shortened the title
  • Can someone explain how to use ReactNative SDK with flexible sync using a code first approach
  • How to use ReactNative SDK with flexible sync using a code first approach
#3: Post edited by user avatar Alexei‭ · 2023-03-08T07:20:31Z (over 1 year ago)
split in paragraphs for better readability
  • 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?
  • 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?
#2: Post edited by user avatar Scriptastrophe‭ · 2023-03-08T00:21:49Z (over 1 year ago)
  • 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 my 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?
  • 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?
#1: Initial revision by user avatar Scriptastrophe‭ · 2023-03-08T00:19:49Z (over 1 year ago)
Can someone explain how to use ReactNative SDK with flexible sync using a code first approach
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 my 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?