How to use the meta.userId function in meta

To help you get started, weā€™ve selected a few meta examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github curiositry / ReaDB / common.js View on Github external
selector: function (searchObject, options, aggregation) {
      let selector = this.defaultConfiguration().selector(searchObject, options, aggregation),
        categoryFilter = options.search.props.categoryFilter;

      if (_.isString(categoryFilter) && !_.isEmpty(categoryFilter)) {
        selector.category = categoryFilter;
      }
      selector["meta.userId"] = options.search.userId;
      
      // selector["$or"] = [{"title":"rework"}];
      // 
      console.log(options.search.userId);
      console.log(JSON.stringify(selector));

      return selector;
    }
  }),
github curiositry / ReaDB / server / main.js View on Github external
getUserStatistics = function(scope, userId, query) {
  console.log(userId);
  if (scope == "private") {
    var uid = Meteor.userId();
  } else if (scope == "public" || userId == Meteor.userId() || !scope ) {
    var uid = userId;
  }
  console.log(userId);
  query["meta.userId"] = uid;
  var books = Books.find(query).fetch();
  console.log(query);
  pageCounts = [];
  var bookCount = 0;
  var booksWithMetadataCount = 0;
  books.forEach(function (book) {
    bookCount = bookCount + 1;
    if(book.hasOwnProperty("publisherMetadata")){
      if(book.publisherMetadata.hasOwnProperty("pageCount")){
        pageCounts.push(book.publisherMetadata.pageCount);
        booksWithMetadataCount = booksWithMetadataCount + 1;
      }
    }
  });
  let pagesRead = 0;
  for (var i = pageCounts.length; i--;){
github curiositry / ReaDB / server / main.js View on Github external
fetchBooks = function(search, sort, fields, user) {
  console.log("fetch books function called");

  var query = {};

  if(typeof search === undefined || search === null){
    query[0] = {"meta.userId":user};
  } else {
    console.log("search found:"+JSON.stringify(search));
    var querySelector = search;
    querySelector["meta.userId"] = user;
    query[0] = querySelector
    console.log("query[0] = " +  JSON.stringify(query[0]))

  }

  if (typeof sort === undefined || sort === null) {
    query[1] = {sort: { "meta.dateReadSort": -1} };
  } else {
    query[1] = sort;
  }

  if (typeof(fields) === undefined || fields === null) {
    query[2] = {fields:{}};
  } else if (fields) {
    query[2] = fields;
  } else {

meta

tool for turning many repos into a meta repo. why choose many repos or a monolithic repo, when you can have both with a meta repo?

MIT
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis