Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


This API is used to create a condition object to be used with other pjs.data APIs, such as get, update and delete.

Parameters

  1. (String) Database column name.
  2. (String) Criteria operator, such as: =, >, >=, <, is null, is not null
  3. Value - The value to that will be injected in the condition
    When using "is null", no value is needed
    when using "is not null", no value is needed
Code Block
titleExamples
let c1 = pjs.data.createCondition("column1", "=", "abc");

let c2 = pjs.data.createCondition("column1", ">=", "aaa");

let c3 = pjs.data.createCondition("column1", "<=", "abc");

let c4 = pjs.data.createCondition("column1", "is not null");

let c5 = pjs.data.createCondition("column1", "is null");

let nowDate = new Date();
let beforeDate = new Date(nowDate .setFullYear(nowDate .getFullYear()-1));
let c6 = pjs.data.createCondition("coldate", "<=", beforeDate);

...