Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import not comming properly #17

Open
syampsijk opened this issue Jan 14, 2018 · 0 comments
Open

Import not comming properly #17

syampsijk opened this issue Jan 14, 2018 · 0 comments

Comments

@syampsijk
Copy link

My exported data is not comming in order,its coming a single character in a column

data.collection("Points”).find({'businessId': ‘shopname’ ,’_created_at':{$gt:d}}, { _id: false}).toArray(function(err, result) {

for(f=0;f<result.length;f++)
{
data = '{'+" Shop : ""+result[f].businessname+"", Points : "+result[f].point+'}';
data = data+" , " +data;
}

//data export
data = [data];
data = data.replace(/'/g, '');
var model = mongoXlsx.buildDynamicModel(data);
mongoXlsx.mongoData2Xlsx(data, model, function(err, data) {
console.log('File saved at:', data.fullPath);
});

This is what i am doing
but i guess my data comes as
['{shop : "shopname",Points : 10 }'];
Please help .i tried replace function but its not working .
Or is it any other issue,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant