In Docpad's documentation it lists a series of Querying helpers. Here's the link. The following list appears at the bottom. Among these helpers are @getCollection, @getFiles, @getFilesAtPath, etc. But there is no indication anywhere that I have been able to locate about what kind of objects are returned by these helpers, and what sort of methods can be called on them, how does one retrieve data, etc? There are a few examples in the Docpad documentation, for example the beginner's guide shows how you'd loop through a collection of html pages in the section "ADDING A MENU LISTING FOR OUR PAGES". From this one can glean that the objects returned here have a method toJSON() that one can call on them. But what else? The documentation also explains that these helper functions are Query-Engine objects of some sort, but in the (Query-Engine documentation)[http://learn.bevry.me/queryengine/guide] I was unable to find any description of how to manipulate these objects. So my question is: does anyone know what the structure of these objects are and how they can be manipulated? Is there a document that I'm missing somewhere?
What methods can be called on Docpad's Query tools?
134 Views Asked by fraxture At
1
There are 1 best solutions below
Related Questions in JAVASCRIPT
- Add additional fields to Linq group by
- couldn't copy pdb file to another directory while consuming wcf web service
- Why are the aliases for string and object in lowercase?
- WPF MessageBox Cancel checkbox check
- Resolve object using DI container with object instance
- Creating a parametrized field name for a SELECT clause
- Does compiler optimize operation on const variable and literal const number?
- Get data from one form to another form in C#
- Writing/Overwriting to specific XML file from ASP.NET code behind
- Deleting Orphans with Fluent NHibernate
Related Questions in DOCPAD
- Add additional fields to Linq group by
- couldn't copy pdb file to another directory while consuming wcf web service
- Why are the aliases for string and object in lowercase?
- WPF MessageBox Cancel checkbox check
- Resolve object using DI container with object instance
- Creating a parametrized field name for a SELECT clause
- Does compiler optimize operation on const variable and literal const number?
- Get data from one form to another form in C#
- Writing/Overwriting to specific XML file from ASP.NET code behind
- Deleting Orphans with Fluent NHibernate
Related Questions in QUERY-ENGINE
- Add additional fields to Linq group by
- couldn't copy pdb file to another directory while consuming wcf web service
- Why are the aliases for string and object in lowercase?
- WPF MessageBox Cancel checkbox check
- Resolve object using DI container with object instance
- Creating a parametrized field name for a SELECT clause
- Does compiler optimize operation on const variable and literal const number?
- Get data from one form to another form in C#
- Writing/Overwriting to specific XML file from ASP.NET code behind
- Deleting Orphans with Fluent NHibernate
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
How I understand it using simple man words:
So in docpad documents are by default interpreted as yaml files (content+metadata). So your query returns object that is this yaml file that you parse to json.
Important to know is that this yaml file is not only "your" defined metadata + content but also some additional metadata defined here http://docpad.org/docs/meta-data. So this is a lot of additional data that you can access.
I assume you use ECO templating and you probably know that it is all about CoffeeScript. So toJSON() method is just one of javascript methods that you can use. I didn't try to check it but I just noticed that anything I want to solve with coffeescript is doable in ECO. So once you parse the object returned by your query to json, you can do anything and call any method you want on JSON object.
Whenever I query for docs of files, I add: <% console.log @document %> to my "for" loop. It returns in the console the whole json object. So you can easily see what objects are returned with your query and what data you can take out of them.
Hope that helps. Cheers