Class: CliquesModels

mongodb/models/clique~CliquesModels

new CliquesModels(connection, options)

Models wrapper to be instantiated w/ specific DB connection instance.

Parameters:
Name Type Description
connection mongoose.connection

DB connection object

options Object
Source:

Methods

createCliqueTree(tree, ancestors)

Given an object representation of a tree, will create all Cliques in the tree and set ancestor arrays & parent links properly.

Tree object should take the form:

{ "alpha": {
      "beta_1": {
          "gamma_11": {
              "delta_111": {},
              "delta_112": {},
              "delta_113": {}
          },
          "gamma_12": {},
          "gamma_13": {}
      },
      "beta_2": {
          "gamma_21": {},
          "gamma_22": {}
      }
   }
}
Parameters:
Name Type Description
tree Object

see above example

ancestors Array

just used in recursion step, can ignore

Source:
To Do:
  • this is a static method, should really be on the Clique schema

getAllBidders(callback)

Gets all bidders in convenient object with Clique ID as key, bidder object as value

Parameters:
Name Type Description
callback
Source:

getAllDefaultAdvertisers(callback)

Gets all bidders in convenient object with Clique ID as key, bidder object as value

Parameters:
Name Type Description
callback
Source: