CAML queries: how to filter folders from result set?

后端 未结 8 1654
遇见更好的自我
遇见更好的自我 2021-02-12 11:38

I\'m using caml query to select all documents which were modified or added by user. Query runs recursively on all subsites of specified site collection.

Now problem is I

相关标签:
8条回答
  • 2021-02-12 12:13

    If you're working with folders and you're using an SPQuery object you also may want to use the ViewAttributes field to allow for recursive item retrieval. Setting the value to Scope="Recursive" will retrieve items from subfolders and will not retrieve the folder objects in the result set.

    myQuery.ViewAttributes = "Scope=\"Recursive\"";
    
    0 讨论(0)
  • 2021-02-12 12:22

    This is what worked for me

       <Where>
          <Eq>
             <FieldRef Name='FSObjType' />
             <Value Type='Number'>1</Value>
          </Eq>
       </Where>
    
    0 讨论(0)
提交回复
热议问题