Skip to content

Instantly share code, notes, and snippets.

@ivanionut
Created May 2, 2019 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivanionut/c8f1d2ec28eb1f1df5de5f3dec3d1c0c to your computer and use it in GitHub Desktop.
Save ivanionut/c8f1d2ec28eb1f1df5de5f3dec3d1c0c to your computer and use it in GitHub Desktop.
queryfilter
<cfscript>
news = queryNew("id,type,title", "integer,varchar,varchar");
queryAddRow(news,[{
id: 1,
type: "book",
title: "Cloud Atlas"
},{
id: 2,
type: "book",
title: "Lord of The Rings"
},{
id: 3,
type: "film",
title: "Men in Black"
}]);
books = news.filter(function(_news) {
return _news.type is 'book';
});
writeDump(news);
writeDump(books);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment