Open leonatoieiri opened 5 years ago
@leonatoieiri Thanks for posting! We'll take a look as soon as possible.
In the mean time, there are a few ways you can help speed things along:
Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly.
For help with questions about Sails, click here.
Same here. Docs say there is another way: .meta({batchSize: 100}).
for eachRecord
. Tried using it with eachBatch (hoped it would work)...
I need to go through 50M records and in batches of 30 it's plain slow.
@leonatoieiri Thanks for taking the time to explore this. To further understand the issue, can you provide us a minimal Sails repo that reproduces the error? I think you might be right about the Waterline version causing this limitation; if that's the case, we'll update the docs until that version is released.
Hi, I have the same problem. Any updates?
Hi @leonatoieiri and @sereisoglu, we discovered that sails-generate was using an old version of sails-hook-orm, this has been fixed. To fix this issue in your existing app, you'll need to update sails-hook-orm to v3.0.0, which includes Waterline 0.14.
@eashaw It's works. Thank you.
According to the documentation eachBatch() have an optional argument to customize the batch size, however this is not working at the moment.
I think this is happening because this feature is only available on Waterline 0.14, and the current version available on npm is 0.13.6
This is the error message:
Sample code:
await Subscriber.stream({ country: 'pt' }).eachBatch(100, async records => { console.log('Got ' + records.length + ' records.'); });
Link to the documentation
Node version: v12.10.0 Sails version (sails): sails@1.2.3 ORM hook version (sails-hook-orm): sails-hook-orm@2.1.1 Sockets hook version (sails-hook-sockets): sails-hook-sockets@2.0.0 DB adapter & version (e.g. sails-mysql@5.55.5): sails-mysql@1.0.1