Answers.Body: <p>You can use the <code>revisionOf</code> parameter (<a href="https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#revisionof" rel="nofollow noreferrer">docs</a>).</p>
  
  <pre class="lang-twig prettyprint-override"><code>{% set revisions = craft.entries.revisionOf(element.id).all|default(1) %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-25T12:59:53.640Z
Answers.Text: Thanks again Oli!
Answers.UserDisplayName: Jamie Wade
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-25T08:57:05.050Z
Answers.LastActivityDate: 2019-10-25T08:57:05.050Z
Answers.UserDisplayName: Oli
Body: <p>We are using <code>getVersionsByEntryId</code> in our XML sitemap to return the number of times an entry has been saved, then comparing that with todays date and the date the entry was created to determine the <code>changefreq</code> over that time:</p>
  
  <pre><code>{% set revisions = craft.app.entryRevisions.getVersionsByEntryId(element.id)|default(1)|length %}
  </code></pre>
  
  <p>Looking at the <a href="https://docs.craftcms.com/api/v3/craft-services-entryrevisions.html#public-methods" rel="nofollow noreferrer">docs</a> however, this is now deprecated:</p>
  
  <blockquote>
    <p>DEPRECATED</p>
    
    <p>Deprecated in 3.2. Use an entry query instead.</p>
  </blockquote>
  
  <p>I can't seem to find anything in the docs for an entry query? Could someone point me in the right direction?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-24T13:07:49.793Z
Comments.Text: I think this is what you need - https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#revisionof
Comments.UserDisplayName: Oli
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-24T14:32:13.330Z
Comments.Text: Cheers Oli, that's exactly what I needed: `{% set revisions = craft.entries.revisionOf(element.id).all|default(1) %}`. Please post that as an answer and I'll accept :-)
Comments.UserDisplayName: Jamie Wade
Tags: <elementquery>
Title: getVersionsByEntryId is deprecated. Can't find the new method?
ThreadText: # getVersionsByEntryId is deprecated. Can't find the new method?
  
  (Asked by: username_0 on 2019-10-24)
  
  We are using `getVersionsByEntryId` in our XML sitemap to return the number of times an entry has been saved, then comparing that with todays date and the date the entry was created to determine the `changefreq` over that time:
  
  ```
  {% set revisions = craft.app.entryRevisions.getVersionsByEntryId(element.id)|default(1)|length %}
  
  ```
  
  Looking at the [docs](https://docs.craftcms.com/api/v3/craft-services-entryrevisions.html#public-methods) however, this is now deprecated:
  
  > DEPRECATED
  >
  > Deprecated in 3.2. Use an entry query instead.
  
  I can't seem to find anything in the docs for an entry query? Could someone point me in the right direction?
  
  **Tags:** elementquery
  
  > **Comments:**
  > **username_1**: I think this is what you need - https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#revisionof  
  > **username_0**: Cheers Oli, that's exactly what I needed: `{% set revisions = craft.entries.revisionOf(element.id).all|default(1) %}`. Please post that as an answer and I'll accept :-)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-10-25. Score: 2 | Accepted answer
  
  You can use the `revisionOf` parameter ([docs](https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#revisionof)).
  
  ```twig
  {% set revisions = craft.entries.revisionOf(element.id).all|default(1) %}
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks again Oli!  
  
  ---
  
  