Example
The following is a search card for all the User cards:
Lewis HoffmanEthan McCutchenJohn AbbeBrandonCsSandersDecko Bot 1gideonroRaymond KinghunabkuSara WingeImaginifyDavid DuncanAaron NelsonFranklin PierceMark "Junctionbox" HadfieldCuongTranNick DynicewilkartMarcus DerenciusTed ErnstGary HurleyJean Nurture Girl RussellMichael MarandaArthur BrockJim RubertoKenneth MacCluneSteveHabibRoseMichael "Networking" MarandaChristoph SturmShari AaronMike BulandStelios LoizidesKachina KatrinaJohn SechrestChuck LangenbergGerry GleasonEdward "ejt" TrudeauSecond PresidentLinnaea MarvellScott KeelerGunnerWord ManBrandon WilliamsCraigLucy PerryBrian KerrMarkus PalloIvan OvertonMarilise SmitKee NetheryMerike KahjuHenri LaupmaaKatie ShriverJennesa QuinnSara BrandtTim HoweGreg ElinJerry MichalskiJordan FowlerNick GrandyJohn CrossNathan YoungMarcello Della LongaAmy Sample WardLee LatourPaul WellsBronwyn XimmRaiphAaron WoodJustin Lowell-BellewLewis TestVinh NguyenEric Harris-BraunBluserTestUsernageshJosh SkovCynthia GentryFernanda IbarraColin J. CameronTim HiteDan RathenbergWyboRichard LinsenbergBrad PhelanWood TurnerBenjamin KudriaKen McCloskeyMaria BaldaufThomas DeVriesJabberWokkyJuan GarciaJay SandersYuShenGiacomo DiGrigoliLiz HenryJustine WittScott TrudeauDaniel EtraMarkus StraussJulien MarieJCK
If you edited that card, you would find the following CQL query:
{ "type": "User" }
which roughly translates to:
Find all cards of the type "User."
or, more casually:
Gimme all the User cards.
See many more examples at CQL Syntax.
How To
To create a search, you set a card's type to Search and then enter CQL Syntax.
(Note for developers: in Search cards, CQL is expressed in JSON, but in the code, it can be expressed in Ruby.)
Tips
- CQL is made of queries within queries. For example, you might do a search for "Person cards with +employee cards that link to Banana Computers". This CQL would include a query for "cards that link to Banana Computers". Often, it's best to build your CQL from the inside out. In our example, you would first try to get a query that returns "cards that link to Banana Computers". Once that works you move on to the rest of the query.
- There are two main ways of creating lists on Decko: by Pointer, in which users create lists manually, and by Search which use CQL to find cards dynamically.
- See the "set item views" section of the nesting card to learn how to configure presentation of search results.
Discussion
I'm having a CQL problem and don't know where to ask for help.
My User cards have a +Locations Visited pointer, and I want a Location+Visitors to be a search that lists everyone who included the location in their Locations Visited plus card.
Visitors+*rform looks like this:
{"plus":["Locations Visited", {"refer_to":"_left"}]}
Which gives me this:
NoMethodError: undefined method `to_key' for nil:NilClass
If I replace "_left" with the location name in quotes, it works.
What do I need to do to make it work? Also, I'd be happy to move this discussion elsewhere if it doesn't belong.
--Brandon Quinn.....Mon Oct 12 12:29:36 -0700 2009
try "_self" instead of "_left". Currently, "_self" refers to the card on which the search is based (ie, the left card), *not* to the search card itself. This is inexcusably confusing, so we're very likely to introduce and migrate to a new nomenclature eventually, but we haven't really determined the best solution yet.
Re belonging, we're now moving to a system where we're trying to steer most of these questions through "Support Ticket", where we think our community of power users will be more likely to see it. But no need to move this one :)
--Ethan McCutchen.....Mon Oct 12 13:06:54 -0700 2009
NOTE: in general, the best way to get CQL help (or any kind of Decko help) is to submit a Support Ticket