Comments (8)
_limit = -1 is equal to unlimited @JohnnyK84
from strapi-plugin-import-export-content.
I am also experiencing the same "We can import and export data but when we want to export more than 100 entries, we can't. (issue)"
from strapi-plugin-import-export-content.
Just installed this plugin and we have the same problem for exporting. By default we are only getting 100 entries back. Anyone find a work around to fix this?
from strapi-plugin-import-export-content.
I would say the cap of 100 in the response is due to Strapis default return _limit which is 100 by default.
This can be seen in the Swagger documentation when running a get on the same API (only 100 results returned). Adjusting the _limit parameter returns more results.
So I guess to fix the _limit parameter on the query which exports the data should include a _limit amount. Unfortunately I don't know where in the code to set this param.
from strapi-plugin-import-export-content.
OK so I found where this is happening in the src code:
In services/exporter/index.js
async function getData(target, options, userAbility) {
const { uid, attributes } = target;
const permissionsManager =
strapi.admin.services.permission.createPermissionsManager({
ability: userAbility,
model: uid,
});
// Filter content by permissions
const query = permissionsManager.queryFrom({}, PERMISSIONS.read);
console.log("QUERY: ", query); // check query data before change
query._limit = 200; // <<<<< set the return limit here
console.log("QUERY: ", query); // check query data after change
const items = await strapi.entityService.find(
{ params: query },
{ model: uid },
);
return Array.isArray(items)
? items.map((item) => cleanFields(item, options, attributes))
: [cleanFields(items, options, attributes)];
}
@EdisonPeM
In the code above I simply added the _limit param as a key to the object. The exporter then exported >100 rows :)
Any chance a fix could be made to either:
- Set the limit to something like 999999
- Have an input that allows the user to specify the _limit amount
BTW Nice work on this plugin ❤
from strapi-plugin-import-export-content.
@mazero Maybe you could create a merge request with your solution.
from strapi-plugin-import-export-content.
I have created a merge request with the solution mentioned above, It would be great if @EdisonPeM merge it.
from strapi-plugin-import-export-content.
OK so I found where this is happening in the src code: In services/exporter/index.js
async function getData(target, options, userAbility) { const { uid, attributes } = target; const permissionsManager = strapi.admin.services.permission.createPermissionsManager({ ability: userAbility, model: uid, }); // Filter content by permissions const query = permissionsManager.queryFrom({}, PERMISSIONS.read); console.log("QUERY: ", query); // check query data before change query._limit = 200; // <<<<< set the return limit here console.log("QUERY: ", query); // check query data after change const items = await strapi.entityService.find( { params: query }, { model: uid }, ); return Array.isArray(items) ? items.map((item) => cleanFields(item, options, attributes)) : [cleanFields(items, options, attributes)]; }
@EdisonPeM In the code above I simply added the _limit param as a key to the object. The exporter then exported >100 rows :) Any chance a fix could be made to either:
- Set the limit to something like 999999
- Have an input that allows the user to specify the _limit amount
BTW Nice work on this plugin ❤
I couldn't find the file you're specifying can you check if its added as a feature because I am stuck at this point. Also should I rebuild after making the change?
from strapi-plugin-import-export-content.
Related Issues (20)
- Plugin Title/Description mismatch
- Error 405 when clicking on Analyze in prod HOT 2
- Import timestamps
- Missing strapi-utils and MaxListenersExceededWarning after running
- Import plugin unexpectedly skipping valid data during import
- Import fails when field is `null` HOT 2
- Request: Reporting import errors when some records fail
- Export is limited to 100 items HOT 2
- [Solved] No Items Imported
- Unable to import CSV: Unexpected mixed field HOT 1
- Can't Export HOT 3
- error for icon package so it wont let me build the project
- Ability to update and delete records HOT 2
- Support plugin models HOT 1
- When will support for strapi 4.x.x come out? HOT 10
- SyntaxError: JSON.parse
- v4 support
- How to use this plugin HOT 4
- Spread JSON objects in CSV outputs to make them more readable HOT 1
- API tokens not working for the plugin endpoints
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strapi-plugin-import-export-content.