Sharepoint/getChanges日期时间筛选器的REST API意外行为 [英] Sharepoint /getChanges REST API unexpected behavior for datetime filter

查看:60
本文介绍了Sharepoint/getChanges日期时间筛选器的REST API意外行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想检索列表资源的创建,更新,删除的更改 日期时间值之后的并带有以下查询:

Hi,
I wanted to retrieve created, updated, deleted changes for List resource after a datetime value with below query:

https://{my_root_web}/_api/site/getchanges?query={'__metadata': { 'type': 'SP.ChangeQuery' },'List':true,'Update': true, 'Add': true,'DeleteObject':true}&$filter=(Time ge datetime'2018-04-02T03:30:16.732Z')




但是不知何故,它会返回一个空数组作为响应.
如果我删除了日期时间过滤器,那么它会从保留期内向我返回列表资源的前1000次更改.
因此,我观察到的是/getChanges API检索前1000个更改,然后对这1000个更改应用日期过滤器.因此,如果您感兴趣的更改不在保留的前1000条记录中 期间将返回一个空响应.

这是/getChanges API的已知问题吗?

如果我使用ChangeTokenStart,则它确实会在该List令牌之后返回前1000个更改.但是我特别希望更改是在datetime值之后而不是在ChangeTokenStart之后.

有什么帮助吗?


BrajMohan




But somehow it returns an empty array as response. 
If I remove the datetime filter then it returns me first 1000 changes for List resource from the retention period.
So, what I observed is that the /getChanges API retrieves the first 1000 changes and then applies the date filter on those 1000 changes. So if the changes that you are interested in are not in the batch of first 1000 records from the retention period it will return an empty response.

Is this a know issue with /getChanges API?

If I use ChangeTokenStart, then it do return me first 1000 changes after that List token. But I specifically want the changes after a datetime value and not after a ChangeTokenStart.

Any help?


BrajMohan

推荐答案

这是我在本地测试的结果.

不使用过滤器:

http://sp:12001/_api/web/getchanges?query = {'__metadata':{'type':'SP.ChangeQuery'},'List' :true,'Update':true,'Add':true,'DeleteObject':true}



使用过滤器:


filter =(Time%20ge%20datetime' 2018-04-05T03:30:16.732Z')> http://sp:12001/_api/web/getchanges?query = {'__metadata':{'type':'SP.ChangeQuery'},'List' :true,'Update':true,'Add':true,'DeleteObject':true}&
filter=(Time%20ge%20datetime'2018-04-05T03:30:16.732Z')">http://sp:12001/_api/web/getchanges?query={'__metadata':{'type':'SP.ChangeQuery'},'List':true,'Update':true,'Add':true,'DeleteObject':true}&


filter =(Time%20ge%20datetime'2018-04-05T03:30 :16.732Z')
filter=(Time%20ge%20datetime'2018-04-05T03:30:16.732Z')


最好的问候,

Lee


这篇关于Sharepoint/getChanges日期时间筛选器的REST API意外行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆