This plug-in allows you to sync some 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 9 functions to sync these collections:

  • Posts (WixBlogPosts)
  • Categories (WixBlogCategories)
  • Tags (WixBlogTags)

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-blog-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 { wixBlog } = SyncWixApps;

export const wixBlog_onCategoryCreated = (event) => wixBlog.onCategoryCreated(event);
export const wixBlog_onCategoryDeleted = (event) => wixBlog.onCategoryDeleted(event);
export const wixBlog_onCategoryUpdated = (event) => wixBlog.onCategoryUpdated(event);
export const wixBlog_onTagCreated = (event) => wixBlog.onTagCreated(event);
export const wixBlog_onTagDeleted = (event) => wixBlog.onTagDeleted(event);
export const wixBlog_onTagUpdated = (event) => wixBlog.onTagUpdated(event);
export const wixBlog_onPostCreated = (event) => wixBlog.onPostCreated(event);
export const wixBlog_onPostDeleted = (event) => wixBlog.onPostDeleted(event);
export const wixBlog_onPostUpdated = (event) => wixBlog.onPostUpdated(event);
interface wixBlog {
    onCategoryCreated(event: any): Promise<void>;
    onCategoryDeleted(event: any): Promise<void>;
    onCategoryUpdated(event: any): Promise<void>;
    onPostCreated(event: any): Promise<void>;
    onPostDeleted(event: any): Promise<void>;
    onPostUpdated(event: any): Promise<void>;
    onTagCreated(event: any): Promise<void>;
    onTagDeleted(event: any): Promise<void>;
    onTagUpdated(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>

  • Parameters

    • event: any

    Returns Promise<void>

  • Parameters

    • event: any

    Returns Promise<void>

  • Parameters

    • event: any

    Returns Promise<void>