foobardb icon indicating copy to clipboard operation
foobardb copied to clipboard

write db

Open muhammedfurkan opened this issue 5 years ago • 9 comments
trafficstars

how can I implementation writeline new key ?

muhammedfurkan avatar Mar 18 '20 12:03 muhammedfurkan

Sorry, Can you elaborate?

bauripalash avatar Mar 19 '20 02:03 bauripalash

Sorry, Can you elaborate?

I mean: how do we save the data on each separate line?

muhammedfurkan avatar Mar 19 '20 08:03 muhammedfurkan

JSON module does the job of writing to file

bauripalash avatar Mar 19 '20 09:03 bauripalash

JSON module does the job of writing to file

each separate line?

muhammedfurkan avatar Mar 19 '20 09:03 muhammedfurkan

JSON module does the job of writing to file

each separate line?

There's no concept of line in JSON They're more like an array

bauripalash avatar Mar 19 '20 09:03 bauripalash

JSON module does the job of writing to file

each separate line?

There's no concept of line in JSON They're more like an array

it constantly records to the same sequence number, not to the next array. for example: {"1":{"name":"test"}}

not recording side by side.

muhammedfurkan avatar Mar 19 '20 10:03 muhammedfurkan

That's not supposed to happen , are you sure you're using the latest script from master branch.?? I did these :

>>> from foobardb import FoobarDB
>>> x = FoobarDB("db.json")
>>> x.set("name" , "pal")
>>> x.set("age" , 0)

and If I do this, I get the expected output:

$ cat db.json
{"name": "pal", "age": 0}

Can you share what are doing exactly.

bauripalash avatar Mar 19 '20 11:03 bauripalash

That's not supposed to happen , are you sure you're using the latest script from master branch.?? I did these :

>>> from foobardb import FoobarDB
>>> x = FoobarDB("db.json")
>>> x.set("name" , "pal")
>>> x.set("age" , 0)

and If I do this, I get the expected output:

$ cat db.json
{"name": "pal", "age": 0}

Can you share what are doing exactly.

just edit json file, not adding side by side

muhammedfurkan avatar Mar 19 '20 11:03 muhammedfurkan

What do you mean by side by side? can you share your script?

bauripalash avatar Mar 19 '20 13:03 bauripalash