mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Add script to export all trial requests
This commit is contained in:
parent
4ae8eacd90
commit
729ebfec8f
1 changed files with 11 additions and 0 deletions
11
scripts/analytics/mongodb/queries/exportTrialRequests.js
Normal file
11
scripts/analytics/mongodb/queries/exportTrialRequests.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
// Latest approved teacher trial requests
|
||||
|
||||
// Usage:
|
||||
// mongo <address>:<port>/<database> <script file> -u <username> -p <password>
|
||||
|
||||
var requests = db.trial.requests.find().toArray();
|
||||
function format(r) {
|
||||
var p = r.properties;
|
||||
return [r.created.getFullYear() + '-' + (r.created.getMonth() + 1) + '-' + r.created.getDate(), r.status, r.type, p.email, p.school, p.location, p.age, p.numStudents, p.heardAbout].join('\t').replace(/[\n\r]/g, ' ');
|
||||
}
|
||||
print(requests.map(format).join('\n'));
|
Loading…
Reference in a new issue