Nov 9, 2012

Example Barista CAML Query


Barista ships with SPCamlQueryBuilder included with the SharePoint bundle. Here’s an example:

var sp = require("SharePoint");

var camlBuilder = new SPCamlQueryBuilder();
var caml = camlBuilder.Where()
        .TextField('FileLeafRef').BeginsWith('B')
        .ToString();

var list = new SPList("/Lists/BaristaUnitTests");

var bListItems = list.getItemsByQuery(caml);
bListItems