Answers.Body: <p>So after some rest, I did find the solution as follow:</p>
  
  <pre><code>'criteria' =&gt; ['section' =&gt; ['pages', 'home'], 'level'=&gt;array(null,1)]
  </code></pre>
  
  <p>This gives me the desire result.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-18T09:18:58.713Z
Answers.LastActivityDate: 2016-04-18T09:18:58.713Z
Answers.UserDisplayName: Alex
Body: <p>Hi I m using elementapi plugin to create an json object from my elements. I would like to get all entries, but not those ones who have a children.</p>
  
  <p>My criteria it looks like this now</p>
  
  <pre><code>'elementType' =&gt; 'Entry',
  'criteria' =&gt; ['section' =&gt; ['pages', 'home']],
  'transformer' =&gt; function (EntryModel $entry) {
  </code></pre>
  
  <p>this returns all entries. For example I have one single <code>home</code> and some other pages the result looks like this:</p>
  
  <pre><code>Home
  About us &lt;- this one has children
  ---------
  test1
  test2
  test3
  ---------
  Contact us
  </code></pre>
  
  <p>I would like to have result like this</p>
  
  <pre><code>Home
  About us
  Contact us
  </code></pre>
  
  <p>Is it possible to achieve this whit some criteria attribute. I've already tried to add level, like this  </p>
  
  <pre><code>'criteria' =&gt; ['section'=&gt;['pages','home'], 'level'=&gt;'!=2' ]
  </code></pre>
  
  <p>not working</p>
  
  <pre><code>'criteria' =&gt; ['section'=&gt;['pages','home'], 'level'=&gt;1 ]
  </code></pre>
  
  <p>it's working but returns only pages not giving me the home section</p>
  
  <p>I've tried hasChildren, hasDescendants none of this is working. </p>
  
  <p>If someone can help, thank you in advance.</p>
  
Tags: <entries><elementcriteriamodel><plugin-elementapi><queries>
Title: Is it possible to skip entries with children?
ThreadText: # Is it possible to skip entries with children?
  
  (Asked by: username_0 on 2016-04-15)
  
  Hi I m using elementapi plugin to create an json object from my elements. I would like to get all entries, but not those ones who have a children.
  
  My criteria it looks like this now
  
  ```
  'elementType' => 'Entry',
  'criteria' => ['section' => ['pages', 'home']],
  'transformer' => function (EntryModel $entry) {
  
  ```
  
  this returns all entries. For example I have one single `home` and some other pages the result looks like this:
  
  ```
  Home
  About us <- this one has children
  ---------
  test1
  test2
  test3
  ---------
  Contact us
  
  ```
  
  I would like to have result like this
  
  ```
  Home
  About us
  Contact us
  
  ```
  
  Is it possible to achieve this whit some criteria attribute. I've already tried to add level, like this
  
  ```
  'criteria' => ['section'=>['pages','home'], 'level'=>'!=2' ]
  
  ```
  
  not working
  
  ```
  'criteria' => ['section'=>['pages','home'], 'level'=>1 ]
  
  ```
  
  it's working but returns only pages not giving me the home section
  
  I've tried hasChildren, hasDescendants none of this is working.
  
  If someone can help, thank you in advance.
  
  **Tags:** entries, elementcriteriamodel, plugin-elementapi, queries
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-04-18. Score: 1 | Accepted answer
  
  So after some rest, I did find the solution as follow:
  
  ```
  'criteria' => ['section' => ['pages', 'home'], 'level'=>array(null,1)]
  
  ```
  
  This gives me the desire result.
  
  
  ---
  
  