Nested fields with Mongo FDW - Mailing list pgsql-general

From Michael Contraveos
Subject Nested fields with Mongo FDW
Date
Msg-id CA+mwVM9R-1vN6hUxOjCRV7-ZBquRBGBPihU9=J=OUs0wCAYoEQ@mail.gmail.com
Whole thread Raw
List pgsql-general
Hello,

I recently installed a PostgreSQL server to this spec:

server v9.3.6
EnterpriseDB mongo_fdw vREL-4_0_0
libbson v1.1.5
mongo C driver v1.1.5

and Mongo is at 2.7.1. Mapping fields in Mongo documents, including _id, has been successful, with the exception of nested fields. Assuming my Mongo document looks like this:

{
    "_id" : ObjectId("5550ebf18cf0280b5fec373a"),
    "message": {
        "order_id": 15
    }
}

I would think this table should do:

CREATE FOREIGN TABLE ats.messages (
    _id NAME,
    "message.order_id" INT
)
SERVER mongo_server OPTIONS (database 'db', collection 'test_collection')

While that doesn't raise any errors, any SELECT against the table shows "message.order_id" as empty. Are nested fields supported in this version of mongo_fdw? If so, what's the proper way to map nested fields to table columns?

thank you,
MC

pgsql-general by date:

Previous
From: Arthur Silva
Date:
Subject: Re: R: Index on integer or on string field
Next
From: Daniel Begin
Date:
Subject: Re: Restarting DB after moving to another drive