mongoose-home-management
v1.0.6
Published
Mongoose shemas to reference Homes, rooms and devices
Downloads
46
Readme
��#� �m�o�n�g�o�o�s�e�-�h�o�m�e�-�m�a�n�a�g�e�m�e�n�t�
�
�
�
�m�o�n�g�o�o�s�e�-�h�o�m�e�-�m�a�n�a�g�e�m�e�n�t� �p�r�o�v�i�d�e�s� �m�o�n�g�o�o�s�e� �m�o�d�e�l�s� �f�o�r� �m�a�n�a�g�i�n�g� �a� �h�o�m�e� �l�i�k�e� �s�t�r�u�c�t�u�r�e�.�
�
�
�
�-� �H�o�m�e�s� �c�a�n� �h�a�v�e� �m�u�l�t�i�p�l�e� �u�s�e�r�s� �a�n�d� �a� �n�a�m�e�.� �
�
�-� �R�o�o�m�s� �c�a�n� �b�e� �l�i�n�k�e�d� �t�o� �o�n�e� �h�o�m�e� �a�n�d� �a�l�s�o� �h�a�v�e� �a� �n�a�m�e�.�
�
�-� �D�e�v�i�c�e�s� �c�a�n� �b�e� �l�i�n�k�e�d� �t�o� �o�n�e� �r�o�o�m� �a�n�d� �a�l�s�o� �h�a�v�e� �a� �n�a�m�e�.�
�
�
�
�
�
�
�
�#�#� �I�n�s�t�a�l�l�a�t�i�o�n�
�
�
�
����b�a�s�h�
�
�n�p�m� �i�n�s�t�a�l�l� �m�o�n�g�o�o�s�e�-�h�o�m�e�-�m�a�n�a�g�e�m�e�n�t�
�
����
�
�
�
�#�#� �U�s�a�g�e�
�
�
�
�F�o�r� �r�o�o�m�s� �a�n�d� �d�e�v�i�c�e�s�,� �a� �s�i�m�i�l�a�r� �i�m�p�l�e�m�e�n�t�a�t�i�o�n� �c�a�n� �b�e� �u�s�e�d� �a�s� �f�o�u�n�d� �b�e�l�o�w�.�
�
�
�
����t�y�p�e�s�c�r�i�p�t�
�
�i�m�p�o�r�t� �{� �I�H�o�m�e�,� �H�o�m�e�M�o�d�e�l� �}� �f�r�o�m� �'�m�o�n�g�o�o�s�e�-�u�s�e�r�-�s�c�h�e�m�a�'�;�
�
�
�
�/�/�C�r�e�a�t�i�n�g� �a� �n�e�w� �h�o�m�e�
�
�c�o�n�s�t� �c�r�e�a�t�e�N�e�w�H�o�m�e� �=� �a�s�y�n�c� �(�u�s�e�r�I�d�:� �O�b�j�e�c�t�I�D�,� �n�a�m�e�:� �s�t�r�i�n�g�)� �=�>� �{�
�
� � � � �l�e�t� �n�e�w�H�o�m�e�:� �I�H�o�m�e� �=� �n�e�w� �H�o�m�e�M�o�d�e�l�(�{� �u�s�e�r�I�d�s�:� �[�u�s�e�r�I�d�]�,� �n�a�m�e�:� �n�a�m�e� �}�)�;�
�
� � � � �a�w�a�i�t� �n�e�w�H�o�m�e�.�s�a�v�e�(�)�;�
�
�}�
�
�
�
�/�/�R�e�t�u�r�n� �a�l�l� �h�o�m�e�s�
�
�c�o�n�s�t� �g�e�t�H�o�m�e�s� �=� �a�s�y�n�c� �(�)�:� �P�r�o�m�i�s�e�<�I�H�o�m�e�[�]�>� �=�>� �{�
�
� � � � �r�e�t�u�r�n� �a�w�a�i�t� �H�o�m�e�M�o�d�e�l�.�f�i�n�d�(�{�}�)�;�
�
�}�
�
����
