This guide lays out all the steps of migrating from MongoDB Atlas Device Sync to PowerSync.
uploadData()
function to manage the uploading of those writes sequentially to the backend.sync-rules.yaml
file associated with your PowerSync project and edit the SQL-like queries based on your database schema. Below is a simple Sync Rules example using a simple database schema. Sync Rules involve organizing data into “buckets” (a bucket is a grouping of data). The example below uses a “global bucket” as a simple starting point — data in a “global bucket” will be synced to all users.
SELECT _id as id
should always be used in the data queries when pairing PowerSync with MongoDB.todos
table:
id
column, since PowerSync automatically creates an id
column of type text
.INSERT
, UPDATE
and DELETE
statements are used to create, update and delete rows.
uploadData()
function in the “backend connector” to use your own backend API. The App Backend Setup section of our docs provides step-by-step instructions for this.
Also see the section on how to set up a simple backend API in our practical MongoDB migration example on our blog.
We also have example backend implementations available (e.g. Node.js, Django, Rails)