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?
138 Views Asked by fraxture At
1
There are 1 best solutions below
Related Questions in JAVASCRIPT
- Angular Show All When No Filter Is Supplied
- Why does a function show up as not defined
- I count the time the user takes to solve my quiz using Javascript but I want the same time displayed on another page
- Set "More" "Less" font size
- Using pagination on a table in AngularJS
- How to sort these using Javascript or Jquery Most effectively
- how to fill out the table with next values in array with one button
- State with different subviews
- Ajax jQuery firing multiple time display event for the same result
- Getting and passing MVC Model data to AngularJS controller
- Disable variable in eval
- javascript nested loops waiting for user input
- .hover() seems to overwrite .click()
- How to sort a multi-dimensional array by the second array in descending order?
- How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?
Related Questions in DOCPAD
- Looking for a Node.js-based full-stack to create a modern blog
- [email protected] install error "node ./cyclic.js"
- Generating only a subset of posts in DocPad
- DocPad v6.57.0 - Failed to load/Unable to parse
- Docpad error 'length' of undefined
- Expose a function to docpad.coffee through a plugin
- docpad plugins server.extend argument options not containing any express middleware with last version of docpad
- How to Publish Docpad Website to AWS S3
- DocPad and MongoDB
- Prevent Docpad from scanning vendor files (but still copy them)
- how to make docpad regenerate only the modified pages?
- Integers Being Added to Array
- Docpad - pull data from JSON file
- Docpad does not run on Windows
- docpad as blogging engine, pagination and problems related to many posts?
Related Questions in QUERY-ENGINE
- Facing Error : -101 THE STATEMENT IS TOO LONG OR TOO COMPLEX in IBM DB2 SQL Run
- How to combine queries in docpad?
- How to query documents in docpad based on arrays of objects
- Accessing Trino Via Python
- Python: Extracting multiple unique source documents from query engine response
- error in accessing tables from hive using apache drill
- Filtering @getFilesAtPath results in Docpad
- What methods can be called on Docpad's Query tools?
- Presto query engine with Azure Data Lake
- Prisma query engine not found on mac M1
- LlamaIndex RAG system with multiple agents and Recursive Retriever
- Snowflake query engine strategy on several with query conditions
- How do I get a collection of files with `write: false` in DocPad
- How to query on nested metadata with Docpad's query-engine
- How to get collections in path using pattern matching?
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 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