agentejo / mongo-lite

Schemaless database on top of SQLite
160 stars 18 forks source link

2 Question #14

Open fehmi opened 7 years ago

fehmi commented 7 years ago

Hello,

You are saying this is for small projects. Can I ask how small? Can you please give some numbers?

And the important one. How can I query for a json-object nested in an array and how?

Thank you very much for this incredible schemaless database.

aheinze commented 7 years ago

hi,

  1. it depends on the size of an entry (document). for now I had no issues with 1000-3000 entries per collection

  2. you can always use a callback function to search within a document:

$collection->find(function($document) {
    return isset($document["items"][0]['anykey']);
});

Greets, Artur

fehmi commented 7 years ago

Thanks for the answer. I have 300.000 column in my dictionary db. Is it OK for mongolite. I want to add meaning row for each column as json object.

{ 'meaning': 'someValue',

'type': 'adjective',

'quotes' : [ {'quote' : 'test1', 'author': 'value1' }, {'quote' : 'test2', 'author': 'value2' } ] }

Which query would return the json-object, in which the value equals 'value2'?

That means, i need this json-object:

{ 'quote' : 'test2', 'author': 'value2'}

Really appreciated.

On Mon, Dec 19, 2016 at 2:43 PM, Artur notifications@github.com wrote:

hi,

1.

it depends on the size of an entry (document). for now I had no issues with 1000-3000 entries per collection 2.

you can always use a callback function to search within a document:

$collection->find(function($document) { return isset($document["items"][0]['anykey']); });

Greets, Artur

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aheinze/mongo-lite/issues/14#issuecomment-267945168, or mute the thread https://github.com/notifications/unsubscribe-auth/AA-oJFxyuhYynKXndNaNItu_sx7K0vs_ks5rJm3agaJpZM4LQMHh .