<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Mango REST API only returning 100 data-points]]></title><description><![CDATA[<p dir="auto">I'm running the latest version of Mango with all modules up to date.</p>
<p dir="auto">When I perform a GET request to the data-points end point I get back a JSON with two top level fields: "total" and "items". The "total" value is 334, however the number of items in the "items" array however is always only 100.</p>
<p dir="auto">For example using my curl wrapper called <a href="https://github.com/ia3io/mangocli" rel="nofollow ugc">mangocli</a>:</p>
<pre><code>$ mangocli data-points | head -n5
{
  "total": 334,
  "items": [
    {
      "id": 1,
$ mangocli data-points | jq '.items | length'
100
</code></pre>
<p dir="auto">This is true for both the v1 and v2 APIs and when I use the swagger interface and curl to make the requests.</p>
<p dir="auto">The user account that the JWT token is associated with has full admin privileges in Mango.</p>
<p dir="auto">It seems like some sort of pagination but I can't find any mention of this behavior in the forum or in swagger. I also tried adding a query parameter for page but that resulted in a 500 error.</p>
]]></description><link>https://forum.mango-os.com/topic/3266/mango-rest-api-only-returning-100-data-points</link><generator>RSS for Node</generator><lastBuildDate>Sun, 09 Aug 2026 13:24:48 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/3266.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Feb 2018 03:26:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mango REST API only returning 100 data-points on Thu, 08 Feb 2018 01:04:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jared-wiltshire" aria-label="Profile: Jared-Wiltshire">@<bdi>Jared-Wiltshire</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a></p>
<p dir="auto">Thanks again for your help!</p>
]]></description><link>https://forum.mango-os.com/post/17256</link><guid isPermaLink="true">https://forum.mango-os.com/post/17256</guid><dc:creator><![CDATA[adamlevy]]></dc:creator><pubDate>Thu, 08 Feb 2018 01:04:04 GMT</pubDate></item><item><title><![CDATA[Reply to Mango REST API only returning 100 data-points on Wed, 07 Feb 2018 16:20:20 GMT]]></title><description><![CDATA[<p dir="auto">Interesting, I had thought there was special handling somewhere in the RQL for nonsense limits, but it turns out that's H2 grammar that <code>LIMIT -1</code> is the same as no limit specified. <a href="http://www.h2database.com/html/grammar.html" rel="nofollow ugc">http://www.h2database.com/html/grammar.html</a></p>
]]></description><link>https://forum.mango-os.com/post/17247</link><guid isPermaLink="true">https://forum.mango-os.com/post/17247</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Wed, 07 Feb 2018 16:20:20 GMT</pubDate></item><item><title><![CDATA[Reply to Mango REST API only returning 100 data-points on Wed, 07 Feb 2018 16:13:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/adamlevy" aria-label="Profile: adamlevy">@<bdi>adamlevy</bdi></a> <code>?limit=x</code> wont work I believe as you noticed, it should be <code>?limit(x)</code>. You can read more about RQL here - <a href="https://github.com/persvr/rql" rel="nofollow ugc">https://github.com/persvr/rql</a></p>
<p dir="auto">There is a default limit of 100 so that if you don't explicitly set a limit it doesn't dump 100,000 data points back.</p>
<p dir="auto">Probably the easiest way to have a play with some RQL for querying data points is to use the watch list builder. Create a new "Point query" type watch list and play around on the query tab.</p>
]]></description><link>https://forum.mango-os.com/post/17246</link><guid isPermaLink="true">https://forum.mango-os.com/post/17246</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Wed, 07 Feb 2018 16:13:44 GMT</pubDate></item><item><title><![CDATA[Reply to Mango REST API only returning 100 data-points on Wed, 07 Feb 2018 09:07:00 GMT]]></title><description><![CDATA[<p dir="auto">Philip</p>
<p dir="auto">Thanks for your prompt reply. I'm a little confused still though.</p>
<p dir="auto">"I suspect you are using an RQL endpoint."</p>
<p dir="auto">I'm querying Mango's REST API V2. The same one that the Swagger interface shows you. Is there some other option here?</p>
<p dir="auto">"You can put <code>limit(-1)</code> in your query string to have no limit."</p>
<p dir="auto">Could you be more specific about how to specify the limit in a REST query?</p>
<p dir="auto">To clarify, with mangocli I am using curl to send a GET request to this endpoint: <code>/rest/v2/data-points</code></p>
<p dir="auto">I tried adding it as a url param ``<a href="https://nus.ia3.io/rest/v2/data-points?limit=-1%60" rel="nofollow ugc">https://nus.ia3.io/rest/v2/data-points?limit=-1`</a> but that fails with 500.</p>
<p dir="auto">Attempting to put it in the body of a GET request also fails.</p>
<p dir="auto">Edit: I just looked back at the swagger interface and saw the note "Use RQL formatted query"<br />
I'm looking into RQL. I'm not yet familiar with it.</p>
<p dir="auto">Edit 2: After reading up on RQL, I played around with my query and got the following URI to work: <code>/rest/v2/data-points?limit(400)</code>. Unfortunately <code>limit(-1)</code> causes a SQL error with MariaDB. I get back the following</p>
<pre><code>{
  "message": "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-1' at line 1",
  "stackTrace": "sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\nsun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
...
</code></pre>
<p dir="auto">Thank you  for pointing me in the right direction!<br />
Where can I read up on what RQL mango accepts other than reading the source code directly?</p>
]]></description><link>https://forum.mango-os.com/post/17245</link><guid isPermaLink="true">https://forum.mango-os.com/post/17245</guid><dc:creator><![CDATA[adamlevy]]></dc:creator><pubDate>Wed, 07 Feb 2018 09:07:00 GMT</pubDate></item><item><title><![CDATA[Reply to Mango REST API only returning 100 data-points on Wed, 07 Feb 2018 04:28:29 GMT]]></title><description><![CDATA[<p dir="auto">Hi adamlevy,</p>
<p dir="auto">I suspect you are using an RQL endpoint. There is a default limit of 100, or whatever is currently here as DEFAULT_LIMIT: <a href="https://github.com/infiniteautomation/ma-core-public/blob/main/Core/src/com/serotonin/m2m2/db/dao/AbstractBasicDao.java" rel="nofollow ugc">https://github.com/infiniteautomation/ma-core-public/blob/main/Core/src/com/serotonin/m2m2/db/dao/AbstractBasicDao.java</a></p>
<p dir="auto">You can put <code>limit(-1)</code> in your query string to have no limit.</p>
]]></description><link>https://forum.mango-os.com/post/17243</link><guid isPermaLink="true">https://forum.mango-os.com/post/17243</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Wed, 07 Feb 2018 04:28:29 GMT</pubDate></item></channel></rss>