Created
May 2, 2019 16:27
-
-
Save ivanionut/c8f1d2ec28eb1f1df5de5f3dec3d1c0c to your computer and use it in GitHub Desktop.
queryfilter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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