Closed saracalihan closed 2 years ago
İskelet yapısı oluşturuldu, basitçe test yazıldı ve şu komutlar eklendi
Model.create(schema, keyPrefix?, modelOptions?)
Model.findById(id)
keyUnique
Model.deleteById(id)
Model.getAll()
keyPrefix
Model.deleteAll()
Model.runCommand(commands)
ModelInstance.save()
Geliştirme yaparken npm run start komutu ile dosyalar takip edilmeli ve lib klasörünün içindeki geliştirme yapılmalı.
npm run start
lib
İskelet yapısı oluşturuldu, basitçe test yazıldı ve şu komutlar eklendi
Model.create(schema, keyPrefix?, modelOptions?)
: Yeni bir model oluşturmak için kullanılır.Model.findById(id)
: model oluştururken belirlenenkeyUnique
değerine göre kayıt getirir.Model.deleteById(id)
:keyUnique
değeri girilen kaydı siler.Model.getAll()
: Bu modelinkeyPrefix
değerini taşıyan tüm kayıtları getirir.Model.deleteAll()
: Bu modelinkeyPrefix
değerini taşıyan tüm kayıtları siler.Model.runCommand(commands)
: girilen komut dizisini çalıştırırModelInstance.save()
: Instance üerinde yapılan değişiklikleri kaydeder.Geliştirme yaparken
npm run start
komutu ile dosyalar takip edilmeli velib
klasörünün içindeki geliştirme yapılmalı.