Grab the first 5000 messages #428
Replies: 1 comment
-
|
Hey @mmendoza-apa try to follow these steps and let me know: 1- You have to make sure that your pull size on the server even permits this much. You can configure it in your controller. Something like this: [Route("tables/[controller]")]
public class MoviesController : TableController<Movie>
{
public MoviesController(AppDbContext context) : base()
{
Repository = new EntityTableRepository<Movie>(context);
Options = new TableControllerOptions { PageSize = 10_000 }; // <- HERE
}
}2- Datasync supports OData query parameters, so on the client side, you will specify the query parameters in the queryparameters property. PullResult pullResult = await dbContext.PullAsync(cfg =>
{
cfg.AddPullRequest<Movie>(options =>
{
options.Endpoint = new Uri("/tables/movies", UriKind.Relative);
options.Query.QueryParameters.Add("$skip", "1000"); // skip the first 1000
options.Query.QueryParameters.Add("$top", "5000"); // take the next 5000
});
});In the example above, we skip 1000 and take the next 5000 as you wanted. There are other OData supported query paramaters you can apply, as from the docs
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I need help trying to perform operations when pulling data. I want take 1000 messages when pulling the data. The only thing I have been able to get working is doing
configure.Query.Where(m => m.CreatedAt >= DateTime.Today.AddDays(-7)). Is there any way to Take when doing a pull? Im sure I am missing some sort of connection.Beta Was this translation helpful? Give feedback.
All reactions