This plugin helps you to sync Wix application collections directly with your MongoDB database, in this way you can perform lookup operations easily.

Currently this feature is experimental and BUG fixes will be added in the future. And right now only available app is Wix Members.

For specific tasks you have pre-built functions that you can use to sync Wix app collections. For example for Wix Members you have created, updated and deleted events where you define it inside the events.js file. In this events.js file you will define these events but you will use pre-built functions from WeivData library to sync the data.

Example code:

import { SyncWixApps } from '@exweiv/weiv-data';
const { wixMembers } = SyncWixApps;

export const wixMembers_onMemberCreated = (event) => wixMembers.onMemberCreated(event);

In the example code above you can understand how it works with a single line of code. You can also add your own logic like this:

import { SyncWixApps } from '@exweiv/weiv-data';
const { wixMembers } = SyncWixApps;

export const wixMembers_onMemberCreated = (event) => {
// Sync Data (no await needed because sync functions are void and doesn't return any value)
wixMembers.onMemberCreated(event);

// Your Own Logic
}

In case of an error you can find logs in WeivDataWixAppsSyncLogs database in your MongoDB cluster. In this database you will have multiple collections to collect logs about each individual application. You can find error logs and it's details there. Plugin only save unexpected error logs not any other logs.

Note: _id fields are automatically generated and they are ObjectId, instead of _id fields you can use entityId field which will be the equivalent of actual item _id.

Basically if you want to find a member by it's _id then use entityId field not _id field.

Index

Interfaces