The transform method

The transform method places the existing value of a Node into a dictionary under a user-defined key. This way, you can create new Nodes inside your existing one.

Command usage:

PYNdatabase.transform(name, new_name)
PYNdatabase.Node.transform(name, new_name)

 

This method can be easily understood with the aid of a before and after diagram:

Before

None

After

{'new_name': None}

 

Examples:

Basic usage:

from pyndb import PYNDatabase
db = PYNDatabse('filename.pyndb')
db.set('hello', 'world')
db.transform('hello', 'example') # <--
print(db.example.hello.val)

Revision #2
Created 26 July 2021 23:56:17 by jvadair
Updated 16 June 2022 15:07:19 by jvadair