Curious QA
Curious QA

Reputation: 91

How to export data from rethinkdb for few columns

using below command, how will we export data from rethinkDB where author='ABC'

rethinkdb export -e dbname.posts --format csv --fields title,author

Upvotes: 1

Views: 491

Answers (1)

taygetos
taygetos

Reputation: 3040

You can filter your data in a new temp table and export that table:

r.db("dbname").table("post")
    .filter({"author":"ABC"})
    .map(function(doc){
        return r.db("dbname").table("temp").insert(doc)
})

then you export the temp table

rethinkdb dump -e dbname.temp ...

Upvotes: 0

Related Questions