This plug-in allows you to sync some Wix Stores collections into your MongoDB cluster. In this way you can perform queries, lookups and all other things easily with WeivData. There isn't any filtering etc. limit for these collections which you may see when you use WixData.

Right now you have 6 functions to sync these collections:

  • Collections (WixStoresCollections)
  • InventoryItems (WixStoresInventoryItems)
  • Products (WixStoresProducts)
  • Variants (WixStoresVariants)

The database name depends on your choice. You can configure it with config function.


We do not suggest writing to these collections, use these collections to only read data from it.


Functions are designed to work with wix-stores-backend APIs Events. Define events inside the events.js file and point the functions you import from this plugin.

Example:

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

export const wixStores_onCollectionCreated = (event) => wixStores.onCollectionCreated(event);
export const wixStores_onCollectionUpdated = (event) => wixStores.onCollectionUpdated(event);
export const wixStores_onCollectionDeleted = (event) => wixStores.onCollectionDeleted(event);
export const wixStores_onProductCreated = (event) => wixStores.onProductCreated(event);
export const wixStores_onProductUpdated = (event) => wixStores.onProductUpdated(event);
export const wixStores_onProductDeleted = (event) => wixStores.onProductDeleted(event);
interface wixStores {
    onCollectionCreated(event: any): Promise<void>;
    onCollectionDeleted(event: any): Promise<void>;
    onCollectionUpdated(event: any): Promise<void>;
    onProductCreated(event: any): Promise<void>;
    onProductDeleted(event: any): Promise<void>;
    onProductUpdated(event: any): Promise<void>;
}

Methods

  • Parameters

    • event: any

    Returns Promise<void>

  • Parameters

    • event: any

    Returns Promise<void>

  • Parameters

    • event: any

    Returns Promise<void>

  • Parameters

    • event: any

    Returns Promise<void>

  • Parameters

    • event: any

    Returns Promise<void>

  • Parameters

    • event: any

    Returns Promise<void>