mongo-lite icon indicating copy to clipboard operation
mongo-lite copied to clipboard

2 Question

Open fehmi opened this issue 8 years ago • 2 comments

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.

fehmi avatar Dec 18 '16 18:12 fehmi

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

aheinze avatar Dec 19 '16 11:12 aheinze

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 [email protected] wrote:

hi,

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 .

fehmi avatar Dec 19 '16 14:12 fehmi