(client/server)

Allow to define the fields returned in queries for Meteor pubblications and methods.
If in a plugin you need to use a new non-standard kepler field, you must first define it in K.schemas and then add it into K.filters to make it come back into the queries results.
All core filters is defined in simple JSON inside a js file filters.js.
Usually in some Kepler plugins these can be extended adding fields, through the filters option inside the plugin.js.

  • K.filters:
    current logged user

    1
    2
    3
    4
    5
    6
    currentUser: {
    fields: {
    name:1, username:1, avatar:1, usersBlocked:1, status:1, statusDefault:1, statusConnection:1, checkin:1, loc:1, mob:1, loginAt:1, createdAt:1, friends:1, gender:1, city:1, lang:1, url:1, loclast:1, hist:1,
    usersPending:1, usersReceive:1, emails:1, settings:1, source:1, profile:1
    }
    }

    data show in panel user, is my friend

    1
    2
    3
    4
    5
    friendPanel: {
    fields: {
    name:1, username:1, avatar:1, usersBlocked:1, status:1, statusDefault:1, statusConnection:1, checkin:1, loc:1, mob:1, loginAt:1, createdAt:1, friends:1, gender:1, city:1, lang:1, url:1, loclast:1, hist:1
    }
    }

    data show in item user, is my friend

    1
    2
    3
    4
    5
    friendItem: {
    fields: {
    name:1, username:1, avatar:1, usersBlocked:1, status:1, statusDefault:1, statusConnection:1, checkin:1, loc:1, mob:1, loginAt:1, createdAt:1
    }
    }

    data show in panel user

    1
    2
    3
    4
    5
    userPanel: {
    fields: {
    name:1, username:1, avatar:1, usersBlocked:1, createdAt:1, friends:1, gender:1, city:1, lang:1, url:1
    }
    }

    data show in item user

    1
    2
    3
    4
    5
    userItem: { 
    fields: {
    name:1, username:1, avatar:1, usersBlocked:1,
    }
    }
  • custom schemas defined by plugin convers:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    filters: {
    currentUser: {
    fields: {
    convers: 1
    //TODO create field coverCount that contains only count of convers no ids list
    }
    },
    placePanel: {
    fields: {
    convers: 1
    }
    },
    placeItem: {
    fields: {
    convers: 1
    }
    },
    userItem: {
    fields: {
    convers: 1
    }
    },
    converPanel: {
    fields: {
    title:1, targetId:1, targetType:1, userId:1, usersIds:1, lastMsg:1, createdAt:1
    }
    },
    converItem: {
    fields: {
    title:1, targetId:1, targetType:1, userId:1, usersIds:1, lastMsg:1, createdAt:1
    }
    }
    }

Examples in plugins

  • custom schemas defined by plugin geoinfo:

    1
    2
    3
    4
    5
    6
    7
    filters: {
    placePanel: {
    fields: {
    geoinfo: 1
    }
    }
    }
  • custom schemas defined by plugin edit:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    filters: {
    currentUser: {
    fields: {
    places:1
    }
    },
    placePanel: {
    fields: {
    userId:1
    }
    },
    friendPanel: {
    fields: {
    places:1
    }
    },
    userPanel: {
    fields: {
    places:1
    }
    }
    }
Edit on GitHub
Licensed under Creative Commons